jtown
jtown

Reputation: 58

MAMP MySQL Command Line "show database;" won't show all Databases

I'm pretty new to using MAMP as well as PHP and MySQL. When I first installed MAMP on my machine, everything was working fine (connections were made, etc.) and I was able to use the command line to work with MySQL without a problem.

Furthermore, when I first started using the command line, I could type the sql command "show databases;" and it listed the three databases that were found on my phpMyAdmin section of MAMP (information_schema, mysql, and performance_schema). I then added my own database to make it four databases and everything was still fine.

However, the last few times I have tried to use the command line and I type "show databases;", it only returns one database: information_schema, and I am unable to access any of the others. But on the phpMyAdmin page, it still shows that there are a total of four databases on my machine. Does anyone know why this is happening and/or how I can get the command line to display all of the databases again in order to make changes to the one I created?

Thanks in advance.

Upvotes: 3

Views: 3885

Answers (1)

Marc Delisle
Marc Delisle

Reputation: 9012

On the command line, use the -u option to indicate which user you want to connect to:

mysql -u root -p

Without that, it must be using an anonymous (blank) user with limited rights.

Upvotes: 6

Related Questions