Upgrading MySQL or MariaDB can sometimes break core system tables inside the mysql schema. One of the most common (and confusing) errors is:
Plugin 'ndbcluster' is disabled.
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
This error prevents MySQL from starting or running mysql_upgrade, which makes the situation even worse. The root cause is almost always missing system tables, incompatible upgrades, or an outdated my.cnf left over from older builds.
If you want experts to handle MySQL upgrades, recovery, or database repair, check our Emergency Server Support or Linux Server Management.
1. Why This Error Happens
During a MySQL upgrade, the database server expects certain system tables to exist:
-
mysql.plugin
-
mysql.user
-
mysql.func
-
mysql.time_zone_name
If one of these is missing or corrupted, MySQL cannot load plugins, authentication modules, or privileges — resulting in startup failure.
Common causes include:
-
Old my.cnf incompatible with new MySQL/MariaDB versions
-
Incomplete package upgrade
-
System tables not rebuilt
-
Permission problems in /var/lib/mysql/
-
MySQL crashing during upgrade
-
Migrating from MySQL → MariaDB (or vice versa)
2. Check the MySQL Error Log
Before applying any fix, check the main log:
journalctl -u mariadb -xe
journalctl -u mysqld -xe
Or the file:
/var/log/mysqld.log
You will usually see:
[ERROR] Table 'mysql.plugin' doesn't exist
[ERROR] Can't open the mysql.plugin table
This confirms the system tables are broken.
3. Fix: Restore Default my.cnf and Restart MySQL
If the upgrade replaced your MySQL configuration with a new version (my.cnf.rpmnew), using the old config file will stop MySQL from starting.
Fix:
cp /etc/my.cnf /etc/my.cnf_backup
cp /etc/my.cnf.rpmnew /etc/my.cnf
systemctl restart mysqld
For MariaDB:
systemctl restart mariadb
Many servers come back online immediately after this step.
4. Fix: Rebuild the mysql.plugin Table Using mysql_upgrade (MySQL 5.7 → 8.0)
Once MySQL is able to start, run:
mysql_upgrade
Or explicitly:
mysql_upgrade --force
This command:
-
Rebuilds missing system tables
-
Fixes incompatible indexes
-
Updates privilege storage engines
-
Repairs orphaned tables
5. Fix: Recreate mysql.plugin Manually (If mysql_upgrade Cannot Run)
When MySQL won’t start at all, rebuild the table manually.
Step 1 — Start MySQL in safe mode:
mysqld_safe --skip-grant-tables &
Step 2 — Recreate table:
mysql < /usr/share/mysql/mysql_fix_privilege_tables.sql
For MariaDB:
mysql < /usr/share/mysql/mysql_system_tables.sql
Step 3 — Restart:
systemctl restart mysqld
6. Fix: Repair the Entire mysql Schema (Last Resort)
If multiple system tables are missing:
mysql_install_db --user=mysql --ldata=/var/lib/mysql/
or
mysql --execute="SOURCE /usr/share/mysql/mysql_system_tables.sql;"
This recreates:
-
mysql.plugin
-
mysql.user
-
mysql.db
-
mysql.procs
-
mysql.time_zone tables
⚠️ Important: This does NOT delete your databases — only system tables.
7. Fix: Permission Errors in /var/lib/mysql/
After upgrade, permissions may be broken:
chown -R mysql:mysql /var/lib/mysql/
find /var/lib/mysql/ -type f -exec chmod 660 {} \;
find /var/lib/mysql/ -type d -exec chmod 770 {} \;
systemctl restart mysqld
8. Fix: SELinux Blocking MySQL Startup
Check:
grep mysql /var/log/audit/audit.log
Fix:
setenforce 0
systemctl restart mysqld
If it works, permanently allow MySQL via:
setsebool -P mysql_connect_any 1
9. Fix: Broken Upgrade Path (MySQL → MariaDB Migration)
If you upgraded:
-
MySQL 5.7 → MariaDB 10.x
-
MariaDB → MySQL 8.0
…then system table formats won’t match.
You must run:
mariadb-upgrade
or:
mysql_upgrade --force
10. How to Prevent This Issue in the Future
-
Never overwrite new my.cnf with old versions
-
Always run mysql_upgrade after updates
-
Avoid mixing MySQL and MariaDB packages
-
Maintain correct permissions and ownership
-
Avoid manual edits in /var/lib/mysql/
-
Test upgrades in staging environment
-
Use package managers (dnf, apt) instead of downloading RPMs manually
-
Enable nightly server monitoring
Our Linux Server Management service includes automated update checks, MySQL monitoring, and recovery.
Example Full Recovery Sequence
If you want a standardized fix to apply during emergencies:
cp /etc/my.cnf /etc/my.cnf.bak
cp /etc/my.cnf.rpmnew /etc/my.cnf
systemctl start mysqld
mysql_upgrade --force
systemctl restart mysqld
If that fails, continue with the manual system table recreation above.
Conclusion
The “Table ‘mysql.plugin’ doesn’t exist” error occurs when MySQL’s system tables break during version upgrades or configuration changes. The fixes range from simple (restoring my.cnf) to advanced (rebuilding system tables manually). With correct upgrade procedures and proper config hygiene, this error can be completely avoided.
If your MySQL server won’t start or the upgrade failed, our team can repair and secure your system through Emergency Server Support or long-term Linux Server Management.


Leave A Comment