国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

解決不能通過mysql.sock連接MySQL問題的辦法

2024-07-24 12:56:08
字體:
來源:轉載
供稿:網友
這個問題主要提示是,不能通過'/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
或者還可以通過修改php.ini中的配置來使php用其他的mysql.sock來連,這個大家自己去找找

或者用這樣的方法:
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

還有:
phpmyadmin的說明書有說
the error message "warning: mysql connection failed: can't connect to local mysql server through socket '/tmp/mysql.sock' (111)..." is displayed. what can i do?

for redhat users, harald legner suggests this on the mailing list:

on my redhat-box the socket of mysql is /var/lib/mysql/mysql.sock. in your php.ini you will find a line
mysql.default_socket = /tmp/mysql.sock
change it to
mysql.default_socket = /var/lib/mysql/mysql.sock
then restart apache and it will work.

here is a fix suggested by brad ummer in the phpwizard forum:

first, you need to determine what socket is being used by mysql.
to do this, telnet to your server and go to the mysql bin directory. in this directory there should be a file named mysqladmin. type ./mysqladmin variables, and this should give you a bunch of info about your mysql server, including the socket (/tmp/mysql.sock, for example).
then, you need to tell php to use this socket.
assuming you are using php 3.0.10 or better, you can specify the socket to use when you open the connection. to do this in phpmyadmin, you need to complete the socket information in the config.inc.php3.
for example: $cfg['servers'][$i]['socket'] = '/tmp/mysql.sock';
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 法库县| 通辽市| 仙居县| 嘉禾县| 娄烦县| 陇西县| 沽源县| 澄迈县| 岢岚县| 金沙县| 阜南县| 通渭县| 霍城县| 调兵山市| 防城港市| 剑川县| 同心县| 兴义市| 凤台县| 周宁县| 闵行区| 鞍山市| 轮台县| 阜城县| 安泽县| 东至县| 宜章县| 防城港市| 浮梁县| 贵定县| 行唐县| 张家港市| 韩城市| 绥德县| 武汉市| 樟树市| 繁昌县| 荣成市| 望都县| 庆元县| 密山市|