问题
I can access all of my databases with HeidiSQL, but if I go to the mysql.exe window and use show databases; only 2 of them show up out of 11. These are all databases on 127.0.0.1. Any ideas on why?
回答1:
You're logging into HeidiSQL as root, so it's showing you all databases, but you're logging into mysql.exe as the current Windows user (since that's the default), so it's only showing you the databases that that user can see. If you run mysql.exe with --user=root --password=..., it will show you all databases.
回答2:
in my case, SHOW DATABASES or SHOW DATABASES; didn't work.
what worked is:
show databases;
回答3:
I am using Oracle mySql
mysql> show databases;
This command show all databases in your SQL server
回答4:
First, you have to log in using your username and password before you issue show databases command on cmd. If you request show databases without this, cmd will only show you default databases. your username and password(optional if you username is root) grant you the needed access to the databases. This is my experience and I hope it helps.
回答5:
If you are in a screen session, that can also truncate your results. Just thought I'd throw that out there since that's what my issue was that led me here ---
来源:https://stackoverflow.com/questions/9558029/in-mysql-the-show-databases-command-doesnt-list-all-of-my-databases