时间:2021-07-01 10:21:17 帮助过:28人阅读
執行 PHP 時出現類似這樣的錯誤訊息: Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /home/httpd/html/show.php on line 9 請將 /tmp/mysql.sock link 到 /var/lib/mysql 目錄裡即可
執行 PHP 時出現類似這樣的錯誤訊息:
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /home/httpd/html/show.php on line 9
請將 /tmp/mysql.sock link 到 /var/lib/mysql 目錄裡即可:
linux# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock