如果php connect mysql 時出現以下情況

Warning: mysqli_connect(): (HY000/2002): 
No such file or directory in *****.php on line 8 
Warning: mysqli_query() expects parameter 1 to be mysqli, 
boolean given in *****.php on line 9 
Connect failed

只要將connect DB 由localhost 改回127.0.0.1 就可以了

define('DATABASE_SERVER', '127.0.0.1');

 

トラックバック

このブログ記事に対するトラックバックURL:

コメント & トラックバック

No comments yet.

Comment feed

コメントする

Smiley face

April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930