在 Mac OS X 上启动 MySQL 时出现问题
我无法在 Mac OS X 10.4.11 上启动 MySQL 服务器。 MySQL 是使用 Macports 安装的。 MySQL 一直运行良好,直到它突然死掉,没有任何明显的原因。
运行“mysql”时,我收到错误消息:
ERROR 2002 (HY000): Can't connect to local MySQL server through
socket '/opt/local/var/run/mysql5/mysqld.sock' (2)
如果我尝试手动启动 MySQL,我收到以下错误消息:
sudo /opt/local/share/mysql5/mysql/mysql.server start
Starting MySQL/opt/local/share/mysql5/mysql/mysql.server: line
159: kill: (636) - No such process
ERROR!
在 /etc/mysql/my.cnf 中,我有:
socket = __PREFIX/var/run/mysqld/mysqld.sock
但是路径“opt/local/var/run /mysqld/" 在我的系统上不存在。
我尝试将套接字路径更改为“__PREFIX/var/run/mysql5/mysqld.sock”(这是套接字所在的位置)。不幸的是,这也没有帮助。
/opt/local/var/run/mysql5/ 的所有者和权限已正确设置。
关于如何重新启动 MySQL 有什么建议吗?谢谢你的建议。
I am not able to start MySQL server on Mac OS X 10.4.11. MySQL was installed using Macports. MySQL was running fine until it suddenly died without any obvious reason.
When running "mysql", I get the error message:
ERROR 2002 (HY000): Can't connect to local MySQL server through
socket '/opt/local/var/run/mysql5/mysqld.sock' (2)
If I try to start MySQL manually, I get the following error message:
sudo /opt/local/share/mysql5/mysql/mysql.server start
Starting MySQL/opt/local/share/mysql5/mysql/mysql.server: line
159: kill: (636) - No such process
ERROR!
In /etc/mysql/my.cnf I have:
socket = __PREFIX/var/run/mysqld/mysqld.sock
But the path "opt/local/var/run/mysqld/" does not exist on my system.
I tried to change the socket path to "__PREFIX/var/run/mysql5/ mysqld.sock" (which is where the socket is located). Unfortunately, this did not help either.
Owner and Permissions for /opt/local/var/run/mysql5/ are correctly set.
Any suggestions on how to start MySQL again? Thanks for your advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也使用 Mac 并从 macports 安装 MySQL。我也经历过你所描述的WTF时刻,我不得不求助于这个解决方案来重新启动MySQL:
这似乎是错误的,太暴力了。但我还没有找到更好的解决方案。我建议搜索 ServerFault.com 并看看其他人是否有更好的方法。如果您确实找到了一些东西,请在这里发帖。
@lacopo:为什么使用 macports?因为 macports 对依赖关系非常挑剔。如果您使用任何依赖于 MySQL 的 macports 工具,则通过 macports 安装 MySQL 会更容易。
I use a Mac too and install MySQL from macports. I have experienced the same WTF moments you describe, and I've had to resort to this solution to restart MySQL:
That seems wrong, too brute force. But I haven't found a better solution yet. I suggest searching ServerFault.com and see if someone else has a better method. Please post here if you do find something.
@lacopo: Why use macports? Because macports is really picky about dependencies. If you use any macports tools that depend on MySQL, it's easier to install MySQL via macports.