How to make MySQL command line works with MAMP?

11,593

The MAMP mysql socket is located elsewhere. If you installed MAMP and own mysql parallel, you have two instances. One with MAMP context, which has its binary in

/Applications/MAMP/Library/bin/

Other one depending on your settings during install.

Make sure to start mysql (the one you would like to work with). You might want to use command line as follows:

/Applications/MAMP/Library/bin/mysql [command goes here]

To access the MAMP mysql server.

Share:
11,593
ericn
Author by

ericn

Engineer, walker, biker

Updated on June 14, 2022

Comments

  • ericn
    ericn almost 2 years

    I love the conveniences of MAMP e.g. phpMyAdmin so I installed it.

    I also installed MySQL via Home Brew because I need MySQL command line (mainly for import and export).

    Now entering mysql results in:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    What should I do?

  • Gerben
    Gerben over 10 years
    For BitNami MAMPStack, I found MySQL here: /Applications/mampstack-5.4.17-0/mysql/bin/mysql