How to work in the same database by workbench and terminal? [closed]

-2

I created a database through the workbench

ButIcannotfinditfromtheMacterminal.HowdoIworkonthesamedatabase?Howtofindthedatabasecreatedbytheworkbench?Andviceversa...

I'mconnectingthroughthecommandmysql-hlocalhost-uroot-pthroughtheterminal.

    
asked by anonymous 13.03.2018 / 22:19

1 answer

1

What should be happening is that you should be trying to connect as follows:

mysql -u usuario -p senha -h localhost database_name

The correct one would be:


/Applications/MAMP/Library/bin/mysql --host=localhost -u usuario -p senha

So you pull the MAMP instance instead of the local one (probably you have installed mysql locally)

Or it might even be the other way around, that you are connecting in the instance with the Workbench, and by the terminal in MAMP.

More alternatives:

Change the Mysql port in MAMP, and connect as follows:

mysql --host=localhost --port=9999 mysql -u root -p

Check the port of your instance and see if it is MAMP's:

mysql> SHOW GLOBAL VARIABLES LIKE 'PORT';
    
14.03.2018 / 11:06