mysql启动时提示data目录问题

在启动MySQL服务时遇到data目录问题,可以尝试两种解决方案:一是注释掉my.cnf配置文件中datadir的指定路径,使用默认目录;二是删除配置中datadir指定目录,让系统自动生成新的数据结构。这两种方法都能帮助解决启动问题。
摘要由CSDN通过智能技术生成

mysql启动服务是提示如下

# mac
mysqld
2019-07-09T03:33:07.358428Z 0 [System] [MY-013169] [Server] /usr/local/Cellar/mysql/8.0.16/bin/mysqld (mysqld 8.0.16) initializing of server in progress as process 7935
2019-07-09T03:33:07.366198Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2019-07-09T03:33:07.366260Z 0 [ERROR] [MY-013236] [Server] Newly created data directory /data/mysql/ is unusable. You can safely remove it.
2019-07-09T03:33:07.366385Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-07-09T03:33:07.366890Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.16/bin/mysqld: Shutdown complete (mysqld 8.0.16)  Homebrew.

方案一

/etc/my.cnf  (brew的配置文件在/usr/local/etc/my.cnf) 文件中的datadir注释掉。

# datadir=/var/lib/mysql

很暴力的解决,使用默认的datadir目录,有mysql自动生成。

 </

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值