我遇到了一个似乎相当普遍的问题,尽管已经阅读并尝试了许多解决方案,但我对这里发生的事情感到非常困惑。问题的症结在于,每次我OS X Yosemite 10.10.3
在安装 MySQL 后重新启动我的 Mac(正在运行)时,它都无法连接、启动或运行,并显示以下消息ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
。
我已经使用 brew 安装了 MySQL,它位于/usr/local/Cellar/mysql/5.6.26/
. 当我从这里运行 mysqld_safe 时,它每次都会退出,无法启动。我查看了错误文件,这些是错误消息:
2015-09-16 10:43:27 7fff77882300 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2015-09-16 10:43:27 1421 [ERROR] InnoDB: Could not find a valid tablespace file for 'bespokedb/concept_terms'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2015-09-16 10:43:27 1421 [ERROR] InnoDB: Tablespace open failed for '"bespokedb"."concept_terms"', ignored.
2015-09-16 10:43:27 7fff77882300 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2015-09-16 10:43:27 1421 [ERROR] InnoDB: Could not find a valid tablespace file for 'bespokedb/terms'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2015-09-16 10:43:27 1421 [ERROR] InnoDB: Tablespace open failed for '"bespokedb"."terms"', ignored.
2015-09-16 10:43:27 1421 [Note] InnoDB: 128 rollback segment(s) are active.
2015-09-16 10:43:27 1421 [Note] InnoDB: Waiting for purge to start
2015-09-16 10:43:27 1421 [Note] InnoDB: 5.6.26 started; log sequence number 12730080990
Warning: World-writable config file './auto.cnf' is ignored /usr/local/Cellar/mysql/5.6.26/bin/mysqld: Error on delete of './auto.cnf' (Errcode: 13 - Permission denied)
2015-09-16 10:43:27 1421 [Warning] World-writable config file './auto.cnf' has been removed.
Warning: World-writable config file './auto.cnf' is ignored
2015-09-16 10:43:27 1421 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 617f6dd0-5c57-11e5-a7aa-9c9a2e17ea50.
我试过让mysql数据目录(位于/usr/local/var/mysql
)文件夹和文件读取、写入和可执行(我知道有点淘气)。我还尝试为 mysql.sock 创建一个 sim 链接/var/mysql/
。除此之外,我已经多次卸载并重新安装了 mysql,并遵循了许多在线详细说明如何删除/添加启动项的例程。总而言之,对于一个非常广泛使用的操作系统上的一个非常广泛使用的工具包来说,这似乎过于复杂了。如果有人愿意在这里详细介绍这些问题是如何出现的/为什么这个过程不简单,那就太好了。我只想学习!
谢谢,
担