在登录mysql时出现下列错误
[root@mysqld1 bin]# ./mysql -u root -p
enter password:
error 2002 (hy000): can't connect to local mysql server through socket '/tmp/mysql.sock' (2)
解决方法:
[root@mysqld1 bin]# ./mysql --socket=/var/lib/mysql/mysql.sock -p
enter password:
welcome to the mysql monitor. commands end with ; or /g.
your mysql connection id is 3
server version: 5.6.17-ndb-7.3.5-cluster-gpl mysql cluster community server (gpl)
copyright (c) 2000, 2014, oracle and/or its affiliates. all rights reserved.
oracle is a registered trademark of oracle corporation and/or its
affiliates. other names may be trademarks of their respective
owners.
type 'help;' or '/h' for help. type '/c' to clear the current input statement.
mysql>
或者
[root@mysqld1 ~]# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock