无法通过套接字‘/var/mysql/mysql.sock’连接到本地MySQL服务器(38)我有一个大问题,试图连接到MySQL。当我跑步时:/usr/local/mysql/bin/mysql start我有以下错误:Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)我确实有mysql.sock在/var/mysql目录。在……里面/etc/my.cnf我有:[client]port=3306socket=/var/mysql/mysql.sock[mysqld]port=3306socket=/var/mysql/mysql.sock
key_buffer_size=16M
max_allowed_packet=8M和在/etc/php.ini我有:; Default socket name for local MySQL connects. If empty, uses the built-in; MySQL defaults.mysql.default_socket = /var/mysql/mysql.sock我已经重新启动Apachesudo /opt/local/apache2/bin/apachectl restart但我仍然有错误。否则,我不知道这是否相关,但当我这么做的时候mysql_config --sockets我得到--socket [/tmp/mysql.sock]
3 回答
胡子哥哥
TA贡献1825条经验 获得超6个赞
socket=/var/lib/mysql/mysql.sock
mysqladmin -u root -p status
sudo chmod -R 755 /var/lib/mysql/
DIEA
TA贡献1820条经验 获得超2个赞
yum -y install mysql mysql-server (or apt-get install mysql mysql-server)
/sbin/chkconfig mysqld on
/sbin/service mysqld start
mysqladmin -u root password 'new-password' (with the quotes)
慕田峪4524236
TA贡献1875条经验 获得超5个赞
添加回答
举报
0/150
提交
取消