22. Linux MySQL 啟動遇到問題([ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!)


參考資料:https://www.cnblogs.com/abclife/p/5052997.html

[ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

測試mysqld啟動mysql server的時候,報如下錯誤:

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,強制啟動(不建議這么做,僅供測試)

# ./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用戶

# ./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指定用戶

[mysqld]
user=mysql

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM