测试mysqld启动mysql server的时候,报如下错误:
1
2 3 4 5 6 |
2015-12-17 00:46:02 10785 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root! 2015-12-17 00:46:02 10785 [ERROR] Aborting 2015-12-17 00:46:02 10785 [Note] Binlog end 2015-12-17 00:46:02 10785 [Note] . /mysqld : Shutdown complete |
原因:
这是因为在测试的时候,使用root来启动的。而从安全角度来讲,不建议用root用户启动。
解决方案:
1.在使用root用户启动的时候,带上--user=root,强制启动(不建议这么做,仅供测试)
1 2 3 |
# ./mysqld --user=root & # ps -ef|grep mysql | grep -v grep root 11055 11019 0 01:02 pts /0 00:00:00 . /mysqld --user=root |
2.启动的时候,指定mysql用户
1 2 3 |
# ./mysqld --user=mysql & # ps -ef|grep mysql |grep -v grep mysql 11165 11100 2 01:06 pts /1 00:00:00 . /mysqld --user=mysql |
3.在my.cnf指定用户