Symptoms
MySQL databases are being created successfully by cPanel but not showing up in phpMyAdmin
Description
First check /usr/local/cpanel/logs/error_log - if you see the following:
DBD::mysql::db do failed: Access denied for user 'root'@'localhost' to database 'DATABASE_NAME' at /usr/local/cpanel/Cpanel/Mysql.pm line 1074.
DBD::mysql::db do failed: Access denied for user 'root'@'localhost' to database 'DATABASE_NAME' at /usr/local/cpanel/Cpanel/Mysql.pm line 1074.
This means that "Grant_priv" is not set properly for root@localhost.
Workaround
In order to fix the problem, simply enter the MySQL server via shell and use the following:
mysql> use mysql;
mysql> update `user` set `Grant_priv`='Y' where`user`='root';
mysql> flush privileges;
Databases will need to be recreated in order for them to show up in phpMyAdmin. You can also manually fix this for each database by entering in:
mysql> replace into user (host,user,password) values('localhost','CPANEL_USERNAME',Password('CPANEL_PASSWORD'));
mysql> grant all on `DATABASE_NAME`.* TO 'CPANEL_USERNAME'@localhost;
mysql> flush privileges;
The above process for existing databases is more complicated if they're using a remote MySQL database server; recreating the databases is recommended.
Comments
0 comments
Article is closed for comments.