因为要测试mysqld服务重启,是否会造成自增列的auto_increment计时器会重置为当前数据集列最大值加1.
使用命令:

service mysql restart
sudo service mysql restart

然后出现:

=== AUTHENTIOATING FOR org.freedesktop.systemd1.manage-units ===
Authrentioation is required to manage system services or units.
Authentioating as : Cloud User (centos)
Passord:
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
=== AUTHENTIOATION FAILED ===
Failed to restart mysql.service: Access denied
See sytem logs and 'systemctl status mysql.service' for details.

用mysql的普通账号、root账号,服务器的都不行

查资料说是用户权限问题,那安装的时候也没这么多鬼扯淡的东西呀
然后去看有没有安装脚本,然后刚好找到,使用里面的命令就解决了

sudo systemctl restart mysqld.service

原因推测:service mysql restart 是重定向到/bin/systemctl restart mysql.service. mysql与mysqld是不同的,前者交互式命令(客户端),mysqld才是后端服务进程,可能是启错了

Logo

更多推荐