红联Linux门户
Linux帮助

Centos 6.5 Mysql 5.7.11启动数据库是报错解决

发布时间:2016-12-21 10:42:23来源:linux网站作者:ASIH
在启动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 *
 
本文永久更新地址:http://www.linuxdiyf.com/linux/27103.html