Home > Database > Mysql Tutorial > 不能通过mysql.sock连接MySQL问题的方法_MySQL

不能通过mysql.sock连接MySQL问题的方法_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:55:23
Original
1242 people have browsed it

问题提示:不能通过'/tmp/mysql.sock'连到服务器

解决方法:php标准配置正是通过'/tmp/mysql.sock',但一些mysql安装方法将mysql.sock放在/var/lib/mysql.sock或者其他地方,你可以通过修改/etc/my.cnf文件来修正它,打开文件,

更改一下:

  [mysqld]
  socket=/var/lib/mysql.sock

 假如更改后mysql程序连不上,可以使用下面的方法继续修改:

  [mysql]
  socket=/tmp/mysql.sock

另外还可以用下面的方法:

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

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