PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, February 14, 2022

[FIXED] How to make MySQL command line works with MAMP?

 February 14, 2022     homebrew, mamp, mysql     No comments   

Issue

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?


Solution

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.



Answered By - Sven Schneider
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing