Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL can't see database

Tags:

database

mysql

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

When I login with wade via PHPMyAdmin I can't see the database source_starcraft. I've only executed this query and created the user prior to this query.

like image 601
Webnet Avatar asked Nov 29 '22 17:11

Webnet


1 Answers

Here something that helped me a lot. Actually I was working with MySQL Workbench.

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

Briefly, it says that if MySQL has an <anonymous> account, and you fail logging in with your user, you end up logged in as the anonymous user, without notice. To find out this you can do:

SELECT user(), current_user();

Here's why:

One important thing to note is that SELECT USER(); shows you your current username and host. Another command, SELECT CURRENT_USER(); shows what you're authenticated as.

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

like image 65
bigstones Avatar answered Dec 09 '22 15:12

bigstones