You actually solved the problem in your first post. Think chroot. ;)
Basically, what we need to do is tell php how to connect to MySQL in the chroot.
Open your php.ini and scroll down looking for [MySQL] and set the following:
mysql.default_socket = /tmp/mysqld.sock
mysql.default_host =...