MAMP 的 PHPMyAdmin 给我 #2002 mysql 错误
因此,只有当我转到本地 PhpMyAdmin 窗口时,我才会收到 #2002 消息。 我搜索了网络,发现了一个终端命令来检查 Mysql 是否会首先运行,而且确实如此。
运行 /Applications/MAMP/Library/bin/mysql -u root -p
给我
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 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.
这看起来不错,我认为所以错误一定与此没有太大关系。
我读到,在 config.inc.php 文件中,您将值“localhost”替换为“127.0.0.1”,但这并没有改变情况。
然后我去 MYSQL 论坛查找,建议检查 my.cnf 文件以检查某些值。但我到处都找不到它。 MAMP 中是否有另一个具有相同功能的文件?
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) 2000, 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
由于得票最高的答案托管在 Posterous 上,而 Posterous 已不复存在,因此这有点孤儿。内容为 已在 Archive.org 存档,但以防万一 也消失,链接的答案是:
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:
好吧,
我终于再次加载了 PHPmyadmin 页面,而没有收到 #2002 错误。我所做的是不断检查 mysql 套接字文件的设置,直到在某个时刻我的 phpmyadmin 确实以应有的方式显示。所以我仍然不太确定为什么会发生这种情况。
我还注意到 MAMP 中的实际端口设置(8888)和我不记得的某个 php 文件(其中是 3306)之间存在端口号不匹配,该文件设置为再次匹配。但不能确定这就是它起作用的原因。
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.
我也遇到了同样的问题。简单修复:
转到 /Application/MAMP/bin/phpMyAdmin/ 并打开
第 71 行上的
config.inc.php
,您会看到$cfg ['Servers'][$i]['port']
由于某种原因,我的计算机上的默认端口已切换,因此我将其设置为
8889
。保存后 phpmyadmin 即可恢复并正常工作!呜呜
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