0

I'm running MySQL 5.1 under Windows 7. If I start the MySQL Command Line Client and type:

show databases;

it returns:

information_schema 
aircraft_taxiing
dvd_collection
eqndb
mydb
mysql
test
test_db

all of which are in the directory in my.ini:

datadir="C:/ProgramData/MySQL/MySQL Server 5.1/Data/"

If I open a command prompt window and type mysql it only returns:

information_schema
test
test_db. 

What happened to the rest of the databases? I've been trying to connect Python to MySQL using MySQLdb and can open any of the three databases, but none of the missing ones.

My goal is to make the Python connection in the end, but I'd like to understand what's going on at the command prompt, too.

3
  • 1
    My guess is you're connecting with different userids in the two cases, and the second userid doesn't have permissions to access those other databases. Commented Aug 27, 2013 at 3:15
  • What does "show grants" show in each case? Commented Aug 27, 2013 at 3:16
  • The Client says: grant all privileges on . to 'root'@'localhost' with grant option, and the command line mysql returns: grant usage on . to ''@'localhost'. Update: I just did: grant all privileges on . to ''@'localhost' with grant option; and now it works. Thanks! Commented Aug 27, 2013 at 12:20

1 Answer 1

0

It depends on the user you are logging in as. If your user doesn't have any priviledges on those databases, you won't be able to see them.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.