If run mysql_connect()
in php cli and return this error:
PHP Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in Command line code on line 1PHP Warning: mysql_connect(): No such file or directory in Command line code on line 1
Using this command to create a symbol link to mysql.sock
in Mac
In my case.
sudo ln -s /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock /tmp/mysql.sock