🧩 Issue: MySQL User Table Error During Plesk Backup
While performing a backup in Plesk Panel, you may encounter one of the following errors:
SQL:
Connection to the database server failed: Column count of mysql.user is wrong.
Expected 42, found 39. Created with MySQL 50173, now running 50556.
Please use mysql_upgrade to fix this error.
or
SQL:
Column count of mysql.user is wrong. Expected 45, found 48.
The table is probably corrupted.
These errors typically occur after a MySQL version upgrade when the
mysql.user table structure becomes incompatible with the current server version.🛠️ Solution: Fix Compatibility Issues Using mysql_upgrade
1. Connect to Your Server via SSH
Log in to your server using the root user:
Bash:
ssh root@server-ip
2. Run the mysql_upgrade Command
Plesk uses theadmin user for database management, and its password is stored in /etc/psa/.psa.shadow. Run the following command to check and fix compatibility:
Bash:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin -T --debug-check MySQL
3. If the Problem Persists, Use the --force Parameter
If the first command doesn’t solve the issue, rerun it with the--force flag to apply upgrades forcibly:
Bash:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql_upgrade -uadmin --force
4. Restart Plesk Services
Once the upgrade is complete, restart the Plesk services:
Bash:
service psa restart
🔍 MySQL Version Compatibility Check
You can verify database version differences via the Plesk interface:Plesk Panel > Tools & Settings > Database Servers
Here, if your current MySQL/MariaDB version differs from the version used when the
mysql.user table was originally created, the
mysql_upgrade command must be executed — otherwise, backups and database operations will continue to fail due to schema mismatches.