什么时候是一个MySQL权限错误不是权限错误

所以过去几天我一直在疯狂。 我有一个mac OSX 10.6.4,我有它的运行mySQL。 在10.6.4更新之后的某个时候,mySQL停止了工作。 我得到一个错误告诉我,MySQL无法findmysql.sock文件。

我已经卸载/重新安装mySQL几次,没有任何帮助。 如果我在我的bin目录中运行mysqld coommand,我得到了一堆导致我相信在数据目录中存在权限错误的错误,但数据由mysql拥有…所以我迷路了。 我不是一个真正的DB人,我只需要在我的机器上连接到wordpress和类似的东西。

这是local.err的一切

101007 21:47:34 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.5.6-rc-osx10.6-x86_64/data error: Found option without preceding group in config file: /etc/my.cnf at line: 2 Fatal error in defaults handling. Program aborted 101007 21:47:34 mysqld_safe mysqld from pid file /usr/local/mysql-5.5.6-rc-osx10.6-x86_64/data/JoeC.local.pid ended 101007 21:48:20 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 101007 21:48:20 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive 101007 21:48:20 [Note] Plugin 'FEDERATED' is disabled. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.3 InnoDB: The first specified data file ./ibdata1 did not exist: InnoDB: a new database to be created! 101007 21:48:20 InnoDB: Setting file ./ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... 101007 21:48:20 InnoDB: Log file ./ib_logfile0 did not exist: new to be created InnoDB: Setting log file ./ib_logfile0 size to 5 MB InnoDB: Database physically writes the file full: wait... 101007 21:48:20 InnoDB: Log file ./ib_logfile1 did not exist: new to be created InnoDB: Setting log file ./ib_logfile1 size to 5 MB InnoDB: Database physically writes the file full: wait... InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: 127 rollback segment(s) active. InnoDB: Creating foreign key constraint system tables InnoDB: Foreign key constraint system tables created 101007 21:48:21 InnoDB 1.1.2 started; log sequence number 0 101007 21:48:21 [ERROR] Can't start server : Bind on unix socket: Permission denied 101007 21:48:21 [ERROR] Do you already have another mysqld server running on socket: /var/mysql/mysql.sock ? 101007 21:48:21 [ERROR] Aborting 101007 21:48:21 InnoDB: Starting shutdown... 

帮帮我?

1.)MySQL正在运行
要么
2.)你没有以正确的权限运行MySQL
在命令之前先尝试一下sudo,然后像root一样运行。
我的Mac要求input密码 – 它可以运行它作为正确的用户

希望这有助于:D

检查mysql进程是否正在运行

 ps -ef | grep mysqld 

这是否给你任何输出? 如果它不只是grep命令本身,那么进程仍在运行。

接下来检查mysql是否打开了任何文件

 lsof | grep mysql 

这是否给你任何输出? 这是由mysql打开的文件列表。 这也许可以解释为什么它是挂着的。

你重新启动你的机器? (你不需要 – 但你可能有一个过程挂起)