mysql报错unix:///var/mysql/mysql.sock_MySQL
程序员文章站
2022-05-19 20:33:05
...
bitsCN.com
如果mysql连接出现
Warning: mysqli_connect() [function.mysqli-connect]: [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in xxx.php on line 14
查看mysql.sock的位置,一般处于
ls /var/mysql
ls /tmp
默认位于 /var/mysql
sudo vi /etc/php.ini
这里根据你的位置来设置,下面三处都要修改
1 pdo_mysql.default_socket=/tmp/mysql.sock 2 mysql.default_socket = /tmp/mysql.sock 3 mysqli.default_socket = /tmp/mysql.sock bitsCN.com
推荐阅读
-
MySQL安装完成配置的时候start service报错
-
MySQL编译报错问题_MySQL
-
php链接mysql数据库报错,PDO错误,php could not find driver
-
MySQL umask 导致备份报错
-
mysql-求助。。java程序访问数据库试用AS别名报错Column 'userid' not found.
-
mysql报错Out of resources when opening file './xxx#P
-
连接MySql超时断开报错问题
-
更新text字段时出现 Row size too large 报错_MySQL
-
在Linux/Unix平台下安装MySQL
-
/var/log/pacct文件导致MySQL启动失败的案例分享