开发者

PHPMyAdmin of MAMP giving me #2002 mysql error

So only when I go to my local PhpMyAdmin window, 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) 200开发者_Python百科0, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of 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?


Since the top-voted answer was hosted on Posterous, which no longer exists, this is a bit of an orphan. The content is archived at Archive.org but just in case that goes away, too, the linked answer was:

Today, I tried to install Mysql on OS X Lion using SQL Packager. I faced a very common issue:

MySQL Forums :: Install :: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Turns out you can regenerate this file in the terminal with this:

ps -e|grep mysqld

sudo mysqld_safe

Thanks David Bocage for the tip.


Alright,

I finally got my PHPmyadmin page loaded again without getting the #2002 error. What I did is I kept reviewing the settings for the mysql socket file until at a certain point my phpmyadmin did show up the way it should. So I'm still not really sure why it happened.

I also noticed there was a portnumber mismatch between the actual port setting in MAMP (8888) and a certain php file I cant remember (where it was 3306) which set to match again. Can't be certain that this is what made it work though.


I had the same problem. Easy fix:

Go to /Application/MAMP/bin/phpMyAdmin/ and open up config.inc.php

on line 71 you see $cfg['Servers'][$i]['port']

For some reason the default ports got switched on my machine, so I set it to 8889. Save and phpmyadmin is back up and working!

Wooo

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜