Symptoms
While trying to start MySQL service, the following error can be found in /var/log/mariadb/mariadb.log
or /var/log/mysql/error.log
error log:
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
FATAL ERROR: Upgrade failed
Cause
MySQL upgrade was started and not completed successfully. Defined password in MySQL database is incorrect.
Resolution
- Login to the server via SSH.
-
Find password for debian-sys-maint user in
/etc/mysql/debian.cnf
:# grep ‘password’ /etc/mysql/debian.cnf
password = PASSWORD
password = PASSWORD -
Stop MySQL:
# service mysql stop
-
Add
option into
skip-grant-tables
in
/etc/mysql/my.cnf
section.
[mysqld]
-
Start MySQL:
# service mysql start
-
Login in MySQL:
# plesk db
MYSQL_LIN: > use mysql
-
Update the password which is defined in
/etc/mysql/debian.cnf
:MYSQL_LIN: > UPDATE mysql.user SET Password = password(‘PASSWORD’) WHERE User = ‘debian-sys-maint’;
-
Remove
skip-grant-tables
option in/etc/mysql/my.cnf
: -
Restart mysql
# service mysql start