1. 程式人生 > >Can‘t connect to local MySQL server through socket

Can‘t connect to local MySQL server through socket

ERROR 2002(HY000)

# mysql

ERROR 2002(HY000):Can't connect to local MySQL server through socket '/tmp/mysql.socket'

# ln -s /usr/local/mysql/data/mysql.sock /tmp/mysql.sock



ERROR 1045 (28000):Access denied for user 'root'@'localhost' (using password: NO)

說明設置了mysql密碼,需要# mysql -uroot -p'密碼'

設置密碼cd /usr/local/mysql/bin下 # ./mysqladmin -u root password '密碼'

Can‘t connect to local MySQL server through socket