Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 396
jtown Avatar asked Jan 22 '26 11:01

jtown


1 Answers

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.

like image 169
Marc Delisle Avatar answered Jan 25 '26 06:01

Marc Delisle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!