On 13 Dec 2006 at 18:59, Gilles MISSONNIER wrote: > Hello, > I use Debian Linux, and I could install (with apt-get install) fine > the Mysql-4.1+apache+php4. > > I tried fine Mysql 5. on the same debian machine. > > Now I want to use mysql 5. through web/php4 > > Then I run into problem, like : > > Warning: mysql_connect(): Can't connect to local MySQL server through > socket '/var/run/mysqld/mysqld.sock' (2) in > /var/www/test/t1.php on line 9 > > Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link > resource in /var/www/test/t1.php on line 10 > from script.php : connexion a la base refuse > > the tool "my_print_defaults" doesn't help. > > any hint?
Hi, First of all, is the mysql server running? If not then the mysql.sock socket file will not be created. If it is, then its probably in a different location to the one that php expects to find it. In which case you have several choices: Change 'mysql.default_socket =' in php.ini to point at the real location of mysql.sock (check with the php.net site to make sure that this option has not changed in the version you have). Change the location that mysql puts the socket file in my.ini (see the manual on dev.mysql.com for the exact syntax). Create a symbolic link from the mysql.sock to the place where php expects to find it: ln -s /current/location/mysql.sock /new/location/mysql.sock I consider the latter the best option as it wont break anything else that depends on the socket. Regards Ian -- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]