mysql - MAMP 的 PHPMyAdmin 给我 #2002 mysql 错误

标签 mysql phpmyadmin

所以只有当我转到本地 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中是否有其他具有相同功能的文件?

最佳答案

由于投票最多的答案托管在不再存在的 Posterous 上,因此这有点孤儿。内容是archived在 Archive.org 但以防万一 that 也消失了,链接的答案是:

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.

关于mysql - MAMP 的 PHPMyAdmin 给我 #2002 mysql 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7293108/

相关文章:

mysql - 范围值的数据库结构

php - PDO SELECT 未完成或引发异常

mysql - 如何使用 MySQL 通过 WHERE 来选择第一个可用的 id?

c# 添加到 mysql 数据库中的 int

mysql - 文件未显示在 htdocs 中

php - 在 MySQL 中为字符列设置空默认值?

PHP/MySQL – 本地主机与 Web 服务

java - Tomcat JDBC 池连接全部卡在Socket Read,没有创建新连接

php - LOAD DATA INFILE - 但还要为每一行添加此列条目?

mysql - (phpmyadmin)(Mysql数据库)如何限制特定键值的插入次数?