简体   繁体   中英

MySQL: Error #2002

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. 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.

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