PHPMyAdmin shows every database when logging in as a user

Last modified: July 29, 2020
You are here:
Estimated reading time: < 1 min

If phpmyadmin shows all the databases on a server when it should only show the users databases do the following:

First be sure a MySQL root password is set.

Add safe-show-database in the mysqld section of /etc/my.cnf

[mysqld]
        safe-show-database

Then restart mysql.

If this does not work do the following:

mysql -u root -p mysql

update `user` set Create_tmp_table_priv = ‘N’, Lock_tables_priv = ‘N’ where user <> ‘root’;

Go back to shell and run mysqladmin reload

If you get an error about a column not found run the following:

mysql_fix_privilege_tables [mysql root password]

then rerun the update command.

Was this article helpful?
Dislike 0
Views: 8