之前在ubuntu等其他的系統上使用mysql並沒有出現這些問題,但是今天使用公司的一個服務器的時候需要自己先下載安裝mysql,這時就出現錯誤了。
mysql服務啓動出問題顯示如下驗證界面
[xx@alarm01v ~]$ service mysql start
Redirecting to /bin/systemctl start mysql.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: root
Password:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===Failed to start mysql.service: Access denied
See system logs and 'systemctl status mysql.service' for details.
所以就是很不明白爲什麼會出現這個問題,因爲是新下的mysql按道理來說密碼什麼的都沒有,查了一下資料據說是因爲centos裏面還有一個內置的MariaDB,這個也是mysql作者的一個女兒的名字做的數據庫的名字。
雖然是兼容的,但是由於mariadb會加上一個安全驗證之類的,還跑去試了一下怎麼跳過安全驗證,都沒有用。
最後看到一個帖子,裏面說直接使用提示的命令就好了
sudo systemctl restart mysqld.service