MySQL cannot see the database

GRANT SELECT ON source_starcraft.udb_ability TO `wade`@`localhost' 

When I log in using wade via PHPMyAdmin, I do not see the source_starcraft database. I just fulfilled this request and created a user prior to this request.

+4
source share
3 answers

If the user you logged into phpMyAdmin has the correct permissions to view the database, but you still cannot see it, this may mean that phpMyAdmin itself is configured to not show it. This is easiest to verify by sending a show databases; request show databases; SQL from phpMyAdmin. If the database you found is displayed, the user is allowed to view it, at least.

There are several configuration directives that can control which databases are visible in phpMyAdmin lists. If you used an unattended installer or script to add phpMyAdmin to your user account, it can also set one to only_db or hide_db. They are also described in the official phpMyAdmin documentation, which should have been included in your installation, as well as in the wiki .

If your user has access to change the settings, you can do this for the current session from phpMyAdmin in the "Settings" section and the "Features" tab. To permanently change these settings, you will need to edit config.inc.php . Its location depends on where phpMyAdmin is installed on your system.

+7
source

Here is something that helped me a lot. I actually worked with MySQL Workbench.

http://bobfield.blogspot.it/2006/10/i-cant-see-my-databases.html

In short, he says that if MySQL has an <anonymous> account and you are not logged in with your user, you are logged in as an anonymous user without notice. To find out, you can:

 SELECT user(), current_user(); 

That's why:

It is important to note that SELECT USER(); shows you your current username and host. Another command, SELECT CURRENT_USER(); indicates that you are authenticated as.

Indeed, in my case user() was mylogin@localhost , current_user() was @localhost (anonymous user).

+10
source

It appears that there may be a conflict or confusion as to which host has received permission and which one is being used.

After FLUSH PRIVILEGES , to remove this feature, I will see which user identified me as soon as I logged in:

 SELECT user(); 

Please note that MySQL always associates the login with the most specific host. See doc . Then compare this to what's in the privilege database.

 SELECT * FROM mysql.user WHERE user='wade'; SELECT * FROM mysql.db WHERE user='wade'; 

To resolve this situation, either REVOKE , or DELETE + FLUSH PRIVILEGES conflict, causing problems (careful not to paint yourself in the corner), or GRANT more privileges to the one that your user is identified a.

+1
source

All Articles