Fatal error: Please read “Security“ section of the manual to find out how to run mysqld as root!

在启动MySQL时报:[ERROR] Fatal error: Please read “Security” section of the manual to find out how to run mysqld as root!

在这里插入图片描述
解决办法有三种:
第一种:使用root用户启动,命令:

service mysqld start --user=root

第二种:使用非root用户启动,修改my.cnf文件:

进入文件:vim /etc/my.cnf
在[mysqld]下输入内容:user=mysql

以上两种都不对时,使用第三种:

检查在/etc/init.d目录下是否存在mysqld文件,如果存在直接删掉就可以了,如果不想删,使用mv命令换一个名字,名字任意起。

在这里插入图片描述
再次使用启动MySQL时就不会出现以上错误了。

Guess you like

Origin blog.csdn.net/huo_wa/article/details/117550307