Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a MySQL database ('myhours') on a production database server that is accessible to one user ('edsf') only, but not to the root user. The command 'SHOW DATABASES' as the root user does not list the 'myhours' database. The same command as the 'edsf' user lists the database:

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| myhours            |
+--------------------+
2 rows in set (0.01 sec)

Only the 'edsf' user can access the 'myhours' database with 'USE myhours'. Neither user seems to have permission to grant further permissions for this database.

My questions are:

Q1. How is it that the root user does not have permission to use the database? How could this have come about? The output of

SHOW GRANTS FOR 'root'@'localhost';

looks fine to me:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*xxx' WITH GRANT OPTION

Q2. How can I recover this situation to make this database visible to the MySQL root user and grant further permissions on it?

Thanks in advance for any help!
-- Ed

share|improve this question

1 Answer 1

you need to flush the permissions

flush privileges;

the connect as root and list databases

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.