View Single Post

   
  #2 (permalink)  
Old 02-16-2008, 05:09 AM
steven mestdagh
 
Posts: n/a
Default Re: And the stupid question of the day that I can't figure out!

i have not used phpmyadmin, but i assume it runs through your httpd, which
is chrooted by default. this means httpd is confined to /var/www or
whatever you specify as chroot directory. hence, it cannot access the
mysql socket located outside this directory.

i can't remember what works best, but you can try to
- ln -s /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock
- or start mysqld with option --socket=/var/www/var/run/mysql/mysql.sock
then httpd will see it as /var/run/mysql/mysql.sock, the default socket
location used by PHP's mysql_connect.

note that, if you are providing a server name instead of an IP number to
mysql_connect or to any other function, you may also have to copy
/etc/resolv.conf to /var/www/etc/resolv.conf, else PHP will not be able to
lookup the name you provided.

if it all works, you should edit your /etc/rc.local accordingly to have
your httpd and mysqld coexist happily by default.

steven.
Reply With Quote