Question

I've just reinstalled everything on my machine. I exported all individual databases from my old MySQL server and I'm attempting to reinstall them on the new one.

However, even after importing all tables, including the "mysql" table which I believe should house all the privileges, no users have any privileges other than grant. Except for the root which has all privileges as expected.

I've flushed the privileges and restarted the database but no privileges are picking up. I looked at the old backup for the entire server and the old INFORMATION_SCHEMA database had far more privileges in it than the current one. However, I know this is a virtual table and should be picking up the data from the MySQL database and others.

How do I restore the privileges?

Was it helpful?

Solution

The privileges tables are located in the mysql database. Check if the content is the same, especially in the tables user, db, tables_priv, columns_priv and proc_priv. Another question to did you also upgraded the server to a newer version? If so, check the MySQL Reference Manual if there aren't any changes in the privilege tables that you need to know about. Run mysql_fix_privilege_tables program on the *unix or SOURCE scripts/mysql_fix_privilege_tables.sql on Windows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top