自从升级操作系统以来,我已经安装了 mysql。但是root密码好像有问题。我已经尝试在网络上以多种方式解决此问题,但到目前为止还没有成功。
systemctl status mysql.service给出:
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2018-05-02 16:57:24 +07; 13s ago
Process: 6172 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=217/USER)
Thg 5 02 16:57:24 thiennguyen systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Thg 5 02 16:57:24 thiennguyen systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Thg 5 02 16:57:24 thiennguyen systemd[1]: Stopped MySQL Community Server.
Thg 5 02 16:57:24 thiennguyen systemd[1]: mysql.service: Start request repeated too quickly
Thg 5 02 16:57:24 thiennguyen systemd[1]: mysql.service: Failed with result 'exit-code'.
Thg 5 02 16:57:24 thiennguyen systemd[1]: Failed to start MySQL Community Server
journalctl -xe给: http ://codepad.org/6EbGVu2Q
mysql_secure_installation给出:
Securing the MySQL server deployment.
Enter password for user root:
Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
mysql -u root -p给出:
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
特别是在我安装的时候,mysql不需要设置root密码,我已经重新安装了很多次。可能是老问题了,但是我在网络上找了很多方法都解决不了,期待大家的帮助。