简体   繁体   中英

can't connect to mysql server

I have a problem installing mysql 5.5.20 on my ubuntu 11.10. after "ps -e | grep mysql" I found mysqld_safe and mysqld is running, but it is not right when I try to connect to the server, the error is like this:


ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


I have check the /etc/my.cnf which locate the mysql.sock in /var/lib/mysql/mysql.sock, and the access right of that folder is:


drwxrwxr-x 2 mysql mysql 4096 2012-01-17 01:54 mysql


after "find mysql.sock" I found it in /var/run/mysql, it is really confusing any help will be appreciated, many thanks~

Often that error message can mean something wrong at an application level, rather than with MySQL.

Open Terminal and attempt to connect to MySQL.

mysql -u root -p

Press Enter , then enter your password and hit Enter again. Once you're in, use SHOW DATABASES to find out what databases are available and if the one you're trying to connect to is there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM