I'm trying to use MySQL to make a login system and I keep getting this error.
winfinity@pcname:~$ mysql
ERROR 2002 (HY000): can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
(2)
I've tried multiple answers. Can someone help?
The above error implies the file
/var/run/mysqld/mysqld.sock
is missing, it can happen ifmysql-server
is not installed.But if
mysql-server
is installed properly and is running, then check for config files.In your case, it seems like the second config is set, so remove or rename
/etc/mysql/my.cnf
, let mysql use/etc/my.cnf
, this may fix your problem.