Home > Backend Development > PHP Tutorial > Solution to the PHP site prompt that '/var/lib/mysql/mysql.sock' does not exist

Solution to the PHP site prompt that '/var/lib/mysql/mysql.sock' does not exist

WBOY
Release: 2016-07-25 08:54:56
Original
1102 people have browsed it
  1. [mysql]
  2. [client]
  3. socket = /tmp/mysql.sock
  4. #Write the correct location of mysql.sock here, usually either under /tmp/ or under /var/lib/mysql/ Copy the code below

2. Modify the connection method: Specify the IP address and use tcp to connect to mysql instead of local sock.

  1. #mysql -h127.0.0.1 -user -ppassword
Copy code

3. Create link Add a link to mysql.sock. For example, if the actual mysql.sock is under /tmp/, type the command:

  1. #ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
Copy the code

Choose any one of the above three solutions to solve the problem and complete Then restart php, nginx (or apache).



source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template