MySQL: Error #2002

711 Views Asked by At

I'm trying to install an opensource software on my local and I'm running zendserver on linux ubuntu.

I created the database and provided a correct user and password. But as soon as I click on submit button I get a MySQL 2002 error saying:

(2002) No such file or directory

I tried to restart apache2 but still I get the same error after I have restarted apache2.

How can I resolve this Mysql error?

1

There are 1 best solutions below

0
On
  1. You don't have permissions to access the directory /var/lib/mysql/whatever.sock because mysql is the owner of the folder or
  2. /path/whatever.sock doesn't exist.

You can try this though [Linux specific, but what other operating systems are there?] Go to /etc/my.cnf and change/add the lines:

[mysqld] datadir=/var/lib/mysql socket=/tmp/mysql.sock [client] socket=/tmp/mysql.sock

This way the client and server use the same socket and it's in a public directory.