Mysql won't show my databases

1

1

After I restart my computer, my databases doesn't show when I run the command show databases; It only shows the following: information_schema test

If i go to /usr/local/var/mysql, my databases files are there.

I'm on OS X 10.6.6.

Rodi01

Posted 2011-03-22T17:02:34.487

Reputation: 113

Answers

1

Do you have an /etc/my.cnf file? if so, cat (display) it to see where it thinks your database files should be (the datadir= line).

If you don't have a my.cnf file, create one as follows:

[client]
port = 3306
socket = /tmp/mysql.sock

[mysqld]
port = 3306
basedir = /usr/local/mysql/
datadir = /where/your/data/files/are/

From what you are saying, your datadir should be /usr/local/var/mysql/.

Restart mysql and see whether the databases turn up.

Linker3000

Posted 2011-03-22T17:02:34.487

Reputation: 25 670

1

You may logged into the wrong user. Are you logged in as root? Usually the root user will have access to all the databases. Then you can give privileges to other users.

vinhboy

Posted 2011-03-22T17:02:34.487

Reputation: 321

I'm logged in as root – Rodi01 – 2011-03-22T17:18:45.730