什么时候 mySQL 权限错误不是权限错误

什么时候 mySQL 权限错误不是权限错误

所以过去几天我都快疯了。我有一台 Mac,OSX 10.6.4,我曾在其上运行 mySQL。在 10.6.4 更新后的某个时候,mySQL 停止工作。我收到一条错误消息,告诉我 mySQL 找不到 mysql.sock 文件。

我已经卸载/重新安装了 mySQL 几次,但都无济于事。如果我在 bin 目录中运行 mysqld 命令,我会收到一堆错误,这些错误让我相信数据目录上存在权限错误,但数据归 mysql 所有……所以我迷路了。我并不是一个真正的 DB 专家,我只是需要在我的计算机上安装一个 DB 来连接到 wordpress 之类的东西。

这一切都超出了本地范围。呃

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

1.) MySQL 正在运行,
或者
2.) 您没有以具有正确权限的用户身份运行 MySQL,
请在执行命令之前先尝试 sudo。因此以 root 身份运行它。
我的 mac 要求输入密码 - 这样它就可以以正确的用户身份运行它

希望这能有所帮助:D

答案2

检查mysql进程当前是否正在运行

ps -ef | grep mysqld

这有输出吗?如果它不只是 grep 命令本身,那么进程仍在运行。

接下来检查 mysql 是否有打开的文件

lsof | grep mysql

这给了你任何输出吗?这是 mysql 打开的文件列表。它可能解释了它为什么会挂起。

您重启过机器吗?(您不需要重启 - 但可能有一个进程还在运行)

相关内容