• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Can't connect to MySQL


Well-known member
I can't connect to mysql using
mysql -u root -p
But I can login into phpmyadmin and my forum are running without problem! o_O


port                           = 3306
socket                         = /var/lib/mysql/mysql.sock


user                           = mysql
default_storage_engine         = InnoDB
pid_file                       = /var/lib/mysql/mysql.pid
It's Percona 5.6 in Debian 7.

Any thought?

Tracy Perry

Well-known member
First thing.. check your disk space. How much free space do you have.
Second, try logging in with mysql -u root -p -h and see if it works.
Third, make sure the /var/lib/mysql/mysql.sock exists and restart the msyql server and try again.

Tracy Perry

Well-known member
Indicates problems communicating with the socket itself. Did you check to see if it exists at the location you specified in your my.cnf?
By using the localhost IP you are bypassing the socket entirely.

This is what I have defined in mine
socket          = /var/run/mysqld/mysqld.sock
socket          = /var/run/mysqld/mysqld.sock

pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
Make sure the socket is defined for client, mysqld and mysqld_safe. I'm running the latest Percona on Debian Wheezy on all my servers and I have the above in their my.cnf.