This forum is no longer active. Please post your questions to our new community site
error when accessing mysql from PHP
|
|
i get the following error when trying to access my database: Warning: mysqli::mysqli(): (HY000/2002): Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2) in /- on line 3 Warning: mysqli::query(): Couldn’t fetch mysqli in /- on line 4 Warning: main(): Couldn’t fetch mysqli in /- on line 4 the calling code is: <?php $mysql = new mysqli(‘localhost’, ‘root’, ‘password’, ‘db’) or die(‘you\’re dead’); if($result) { while($row = $result→fetch_object()) { I’m sure I am missing a configuration step somewhere, but can’t seem to get the right combination. thank you, |
|
|
Hi, Could you try to specify the socket in the /php/etc/php.ini file?
Cheers. |

