之前在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