刚安装好的MySQL5.7.12,执行service mysqld start时报错,内容如下:

[shell]
2017-02-19T07:52:53.807647Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2017-02-19T07:52:53.809065Z 0 [ERROR] –initialize specified but the data directory has files in it. Aborting.
2017-02-19T07:52:53.809095Z 0 [ERROR] Aborting

[/shell]

其中红色字体里面说明,mysql中的data目录已经有数据了,解决方案:

vim /etc/my.cnf,

datadir=/var/lib/mysql, 这个是data保存目录,进入/var/lib/mysql后,查看到确实有数据:


将/var/lib/mysql备份,然后重新启动mysql:

---------------------
作者:liyf155
来源:CSDN
原文:https://blog.csdn.net/liyf155/article/details/61420126
版权声明:本文为博主原创文章,转载请附上博文链接!

发表评论

邮箱地址不会被公开。 必填项已用*标注