Jerinos
Jerinos

Reputation: 349

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

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?

Upvotes: 20

Views: 42393

Answers (6)

Adrian M
Adrian M

Reputation: 7

I had the same problem It seems that in never version you need to add semicolon at the end of the command.

SHOW DATABASES;

Work fine for me with lowercase and uppercase letters.

Upvotes: 0

jjordan
jjordan

Reputation: 42

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 ---

Upvotes: 0

Olayinka Popoola
Olayinka Popoola

Reputation: 53

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.

Upvotes: 1

KawaiKx
KawaiKx

Reputation: 9908

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

what worked is:

show databases;

Upvotes: 19

Ramkailash
Ramkailash

Reputation: 1850

I am using Oracle mySql

mysql> show databases;

This command show all databases in your SQL server

Upvotes: 5

ruakh
ruakh

Reputation: 183251

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.

Upvotes: 28

Related Questions