在启动MySQL时报错
service mysqld start
Initializing MySQL database: 2016-12-21T10:44:40.732306Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-12-21T10:44:40.735257Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2016-12-21T10:44:40.735294Z 0 [ERROR] Aborting
报错一
0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
解决方法
vim /etc/my.cnf
添加
explicit_defaults_for_timestamp=true
报错二(原因是/var/lib/mysql目录里面有数据)
2016-12-21T10:44:40.735257Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2016-12-21T10:44:40.735294Z 0 [ERROR] Aborting
解决方法删除内部数据
cd /var/lib/mysql
rm -rf *