Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In mysql, the show databases; command doesn't list all of my databases

Tags:

mysql

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?

like image 414
Jerinos Avatar asked Mar 04 '12 19:03

Jerinos


People also ask

Which command shows all databases in the current folder?

To show all databases in the current connection, you use the . databases command. The . databases command displays at least one database with the name: main .


2 Answers

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.

like image 160
ruakh Avatar answered Oct 22 '22 10:10

ruakh


in my case, SHOW DATABASES or SHOW DATABASES; didn't work.

what worked is:

show databases;
like image 42
KawaiKx Avatar answered Oct 22 '22 10:10

KawaiKx