报错背景

mysql 想要重新格式化 mysqld --initialize,结果报错。

报错现象

报错:MySQL initialize specified but the data directory has files in it. Aborting.

报错原因

initialize specified but the data directory has files in it. Aborting.

由这句话可知,data目录下有文件了,所以格式化失败。

报错解决

找到这个目录

目录所在位置可以在mysql的配置文件中查询
# vim /etc/my.cnf

报错:MySQL initialize specified but the data directory has files in it. Aborting.

 

将此文件夹删除
# rm -rf /var/lib/mysql
重新格式化
# mysqld --initialize

 

相关文章:

  • 2021-06-03
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-04-10
  • 2022-12-23
  • 2022-02-13
猜你喜欢
  • 2021-12-05
  • 2021-07-11
  • 2022-01-15
  • 2021-11-29
  • 2022-12-23
  • 2021-12-25
相关资源
相似解决方案