Mamp Got Error 2002
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business
/applications/mamp/tmp/mysql/mysql.sock Missing
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation can't connect to local mysql server through socket '/applications/mamp/tmp/mysql/mysql.sock' (2) Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just
Mamp Mysql Not Starting
like you, helping each other. Join them; it only takes a minute: Sign up PHPMyAdmin of MAMP giving me #2002 mysql error up vote 1 down vote favorite So only when I go to my local PhpMyAdmin window, error 2002 hy000 can t connect to local mysql server through socket tmp mysql sock 2 mac I get the #2002 message. I searched the net and I found a terminal command to check if Mysql would be running in the first place and it does. Running /Applications/MAMP/Library/bin/mysql -u root -p gives me Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.5.9 Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of uninstall mamp Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. That doesn't look bad I think so the error must not have much to do with that. I read that there's the config.inc.php file where you replace the value 'localhost' with '127.0.0.1' but that didn't change the situation. Then I went looking in MYSQL forums it is suggested to check the my.cnf file to check for certain values. but I can't find it anywhere. Is there another file that has the same function in MAMP? mysql phpmyadmin share|improve this question asked Sep 3 '11 at 12:27 Immers 2461518 did it run ok before or was giving this error after installation? If so, just reinstall the whole thing. –hmd Sep 3 '11 at 12:30 I actually already uninstalled and reinstalled MAMP and Still giving me the same 2002 error. –Immers Sep 3 '11 at 12:31 which OS are you using? I would recommend us xampp. –hmd Sep 3 '11 at 12:35 I'm running Mac OSX. The problem came with drupal sites. Xampp doesn't see my drupal installations for some reason which has been an issue on its own in the past and I solved that using MAMP
connect to local MySQL server through socket '/tmp/mysql.sock' (2) 26 Nov I instaled MAMP and it worked great. However,
Mamp Download
when I tried to access mysql from the shell I was can t connect to local mysql server through socket var lib mysql mysql sock 2 getting $ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to
Mamp Pro
local MySQL server through socket '/tmp/mysql.sock' (2)
However, using a full path to MAMP binary worked. $ /Applications/MAMP/Library/bin/mysql -u root -p
MAMP's mysql works with http://stackoverflow.com/questions/7293108/phpmyadmin-of-mamp-giving-me-2002-mysql-error another socket file which is located at /Applications/MAMP/tmp/mysql/mysql.sock All you have to do is: sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock UPDATE: As it turns out the above soft link gets erased by the system, so you need to run the command every once in a while. At one point it got too frustrating so https://boriskuzmanovic.wordpress.com/2008/11/26/mamp-error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock-2/ I figured out a permanent way to take care of this problem. Open /etc/my.cnf and add/edit these lines: [mysqld]
socket=/Applications/MAMP/tmp/mysql/mysql.sock
[client]
socket=/Applications/MAMP/tmp/mysql/mysql.sock Instead of telling MAMP which socket file to use, you are instructing the mysql client to use MAMP's default socket. Let me know if this works for you. Share this:TweetEmailLike this:Like Loading... Related 12 Comments Posted by boriskuzmanovic on November 26, 2008 in Mac OS Tags: mamp, mysql ← How to fix /tmp 100% usageproblems Coda books with custom images for Code Igniter, MySQL,PHP… → 12 responses to “MAMP: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)” Eb October 19, 2011 at 8:24 pm Hi, I am a complete novice and no nothing about programming but love designing using simple software. I recently installed the free version of MAMP to create a database. It was working great until I tried changing the default login and pw from "root"
as it should - until I tried to install WordPress on my MacBook. I got a database connection error very early during the WordPress installation process. So I http://fischerlaender.de/apple-mac/mac-os-x-trouble-with-mamp-mysql tried to talk to the mysql server with the mysql command line tool and got this error message: macbook:~ sf$ /Applications/MAMP/Library/bin/mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) This was strange as the mysql server was indeed running; I could verify this by an ps command. Futhermore phpMyAdmin, as provided by MAMP, connect to worked flawlessly. Doing some Google research told me that the problem was connected with the location of mysql.sock. Running ps -awwx | grep mysql showed, that mysqld had been started by MAMP with the option --socket=/Applications/MAMP/tmp/mysql/mysql.sock, whereas the mysql tool and WordPress assume the socket file here: /tmp/mysql.sock. With this information the solution is easy: sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock This creates a symbolic link from connect to local the location expected by mysql and wordpress to the location where the socket file resides. Now I can access my mysql server with the mysql command line tool and my local WordPress installation can also talk to the database. Abgelegt in: Apple Mac • Web 2.0 86 Kommentare: » Blog Archive » Mac OS X: Trouble with MAMP MySQL | 10. Juli 2007 | 11:00 Uhr […] Mac OS X: Trouble with MAMP MySQLMAMP is for Mac what XAMPP is for windows: A very easy-to-use, but Mac-like web development solution. Everything worked out-of-the box as it should - until I tried to install WordPress on my MacBook. I got a database connection error very early during… […] I thought using a Mac was supposed to be simple? | The Social Publishing Blog | 2. September 2007 | 19:56 Uhr […] socks, sockets and sudo's - something i really don't care or want to learn. Thankfully, the fix was simple, but virtually impossible to guess or work out the solution for oneself. I thought using […] Matt | 17. September 2007 | 23:11 Uhr thanks for the help Stefan - this is really helpful! Mat