Today I encountered an issue that I can't find my database created by a ROR project from mysql cli. After some spike, It turns out that I didn't login as root, I just use mysql without any argument. So my question is if you login with a bare 'mysql' command, who you are login as and what is the permission you have?
By the way, the mysql version is 5.5 .
Reply for marked as duplicate:
Actually, I don't believe this is dup with MySQL Utilities - ~/.my.cnf option file; I checked my env, I don't have a default config file and I didn't store any password anywhere. My question is who I'm login as if use a bare mysql command. One clue is when I try to query mysql.user, I got message below. So I think I'm login as @localhost, but where this name come from?
Blockquote mysql> SELECT host, user, password from mysql.user; ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user' mysql>