当前位置:Gxlcms > 数据库问题 > thinkphp 数据库连接报错 SQLSTATE[HY000] [2002] No such file or directory

thinkphp 数据库连接报错 SQLSTATE[HY000] [2002] No such file or directory

时间:2021-07-01 10:21:17 帮助过:13人阅读

/mysql.conf.d/mysqld.cnf
socket          = /var/run/mysqld/mysqld.sock

在php.ini中关于mysql的socket路径的地方,修改如如下

[Pdo_mysql]
; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/pdo_mysql.cache_size
pdo_mysql.cache_size = 2000

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
; http://php.net/pdo_mysql.default-socket
pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock

 



thinkphp 数据库连接报错 SQLSTATE[HY000] [2002] No such file or directory

标签:mysqld   name   use   cts   https   pdo   mys   connect   连接   

人气教程排行