Bobcares

Table ‘mysql.user’ doesn’t exist error in Plesk | How to fix

by | Dec 27, 2021

Table ‘mysql.user’ doesn’t exist error in Plesk causing trouble? We have a solution for you. 

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.

Let’s take a look at how our Support Team recently helped out a customer with the Table ‘mysql.user’ doesn’t exist error in Plesk.

How to resolve Table ‘mysql.user’ doesn’t exist error in Plesk

In some scenarios, MySQL service fails to start and often results in an error message in the /var/log/mysql/error.log file. This error message helps us narrow down the root cause behind the error and come up with an appropriate solution.

If we come across the error shown below, it clearly indicates that the MySQL system database is corrupt or missing.

Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

Our Support Techs recommends the following steps to resolve this specific error:

  1. First, we have to connect to the Plesk server through SSH.
  2. Next, we have to modify my.cnf file with the help of these steps:
    • On CentOS or RHEL based distributions:
      # vi /etc/my.cnf
    • On Debian or Ubuntu-based distributions:
      # vi /etc/mysql/my.cnf
  3. Then we will add the following line under the [mysqld] section as seen below:
    [mysqld]
    skip-grant-tables
    <...>
  4. Next, we will save the changes and close my.cnf file.
  5. After that, we have to restart the MySQL or MariaDB service with these commands:
    # systemctl restart mysql
    # systemctl restart mariadb
  6. Then, we will switch to the directory containing the daily dumps:
    # cd /var/lib/psa/dumps
  7. Here we will restore the database with the help of the latest daily dump:
    # zcat mysql.daily.dump.0.gz | sed -n '/-- Current Database: `mysql`/,/-- Current Database:*/p' | plesk db
  8. Next, we have to remove the skip-grant-tables directive from step 2.
  9. Finally, we have to restart the MySQL or MariaDB service with these commands:
    # systemctl restart mysql
    # systemctl restart mariadb

[Seeking a solution to another query? We have your back..]

Conclusion

To sum up, the skilled Support Engineers at Bobcares demonstrated how to resolve Table ‘mysql.user’ doesn’t exist error in Plesk.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.