环境:centos6.3
[root@localhost mysql]# /etc/rc.d/init.d/mysqld stop
Shutting down MySQL. [确定]
[root@localhost mysql]# /etc/rc.d/init.d/mysqld start
Starting MySQL. [确定]
[root@localhost tmp]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
进不去mysql,这里我mysql是正常启动了,但是mysql.sock文件地址是不对的。
我的是/tmp/mysql.sock
这里做个软链就可以了
[root@localhost mysql]# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
[root@localhost mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.10 Source distribution
OK,进来了,都怪在linux下操作少啊,现在开发中需要一些linux软件就各种问题来了