我这个mysql.sock在/tmp/mysql.sock里,是不是在var/lib/mysql/mysql.sock'(2)'找不到问题还那些原因!接着看下面:==============================================================...
我这个mysql .sock在/tmp/mysql .sock里,是不是在var/lib/mysql/mysql.sock' (2)'找不到问题还那些原因!接着看下面:
================================================================
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
==========================================================
[root@localhost ~]# mysqladmin -u root password root
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql .sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' ex ists!
[root@localhost ~]# ps au x|grep mysqld
root 5135 0.0 0.2 4776 1220 pts/0 S 17:43 0:00 /bin/sh /opt/my sql/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost .localdomain.pid
mysql 5250 0.0 0.6 19476 3260 pts/0 Sl 17:43 0:00 /opt/mysql/libe xec/mysqld --basedir=/opt/mysql --datadir=/var/lib/mysql --user=mysql --log-erro r=/var/log/mysqld.log --pid-file=/var/lib/mysql/localhost.localdomain.pid --sock et=/tmp/mysql.sock --port=3306
root 5265 0.0 0.1 4160 704 pts/0 R+ 17:47 0:00 grep mysqld
===============================================================
/etc/my.cnf配置如下:
[mysqld]
datadir=/var/lib/mysql
socket=/tmp/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid===================================================================
展开