我试图让mysql在我的mac上运行。我使用macports进行初始安装,但无法通过此mysql套接字错误。 注意:如果macports在下面看起来很奇怪,它会将版本号附加到命令中。无法在mac OS X上启动mysql获取mysql.sock连接错误
错误:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
我得到这个错误时:
mysqladmin5 -u root password
and also
mysql5 -u root -p
我的安装和启动过程
与MacPorts的MySQL安装:
sudo port install mysql5 +server
sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
开始是这样的:
sudo /opt/local/bin/mysqld_safe5
也试过:
sudo /opt/local/share/mysql5/mysql/mysql.server start
我怎么一直试图解决这个
我尝试添加到my.cnf文件
[mysqld_safe] socket = /tmp/mysql.sock
唯一的问题是没有my.cnf文件开始,所以我不知道我是否在正确的地方创建了它。
我也打算将mysql.sock文件链接到/ tmp目录,但系统上没有任何mysql.sock文件。
所以我创建了一个文件的mysql.sock
touch /tmp/mysql.sock
But this didn't work either.
我想,也许我错过了一些在安装过程中,因为我无法找到系统上的my.cnf文件或文件的mysql.sock。
这是我使用的指南:
http://2tbsp.com/content/install_and_configure_mysql_5_macports
链接已损坏:( – evanmcd 2010-10-17 04:01:03
已修复。很抱歉,我移动了我的博客。 – djburdick 2010-10-19 01:55:58
链接被再次破坏:( – bfontaine 2013-08-05 17:42:29