LoginSignup
3
2

More than 5 years have passed since last update.

MySQL5.7で"initialize specified but the data directory has files in it. Aborting."

Last updated at Posted at 2016-03-19

原因はいろいろあるみたいですが、私の場合はvalidate_password=OFFを入れたmy.cnfを、mysqldの初回起動前に入れてたのがよくなかったみたいです。

my.cnf
[myslqd]

validate_password=OFF

:ng: NG

# yum -y install mysqld
# cp my.cnf /etc/my.cnf
# systemctl start mysqld.service
--> 起動失敗

どうも初回起動時にvalidate_password=OFFが入るのは許されざる感じです。以下なら通りました。

:ok: OK

# yum -y install mysqld
# systemctl start mysqld.service

# cp my.cnf /etc/my.cnf
# systemctl restart mysqld.service

普通にmysql_secure_installation使えば問題ないんでしょうが、自動化とかやってて題記のエラーが出たら、こちら確認してみてください。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2