Symptoms
MySQL databases are being created successfully by cPanel but not showing up in phpMyAdmin.
Within, /usr/local/cpanel/logs/error_log you see:
CONFIG_TEXT: 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.
Cause
Grant_priv is not set properly for root@localhost
Resolution
- Access your cPanel & WHM server as the
rootuser. - Navigate to Home / Server Configuration / Terminal
- Use the
mysqlcommand to enter the MySQL commandline.
# 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;
Warning: 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.