Forum Moderators: coopster

Message Too Old, No Replies

No Connect after moving MySQL Tables

/var filled up, so entire mysql dir moved; now 'cannot connect' messages

         

AlexK

4:46 am on Jul 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Centos4 (aka RedHat RHEL):

This should have been the simplest thing...

A combination of adding new pages into the mysql tables, growing log files + yum cache filled up the /var partition to the point that mysql hung with a plaintive "Waiting for someone to free space..." (Disk is full ... Errcode: 28) whilst trying to optimise a large table.

There was plenty of disk space elsewhere, so--after taking down both apache + mysql, moved the entire /var/lib/mysql tree to another partition, changed all the my.cnf directory-references and restarted apache + mysql.

All pages then gave the bare "Cannot connect to the Database-server at this time." in the connect-script, although command-line mysql worked fine. When I reversed all of the above paragraph everything was back to normal.

I have checked php.ini, /etc/httpd/conf.d/php.conf and /etc/php.d/mysql.ini for another directory config and can find nothing. Likewise with a web-search. SELinux is disabled.

What have I missed?

AlexK

12:00 am on Jul 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What I forgot was *not* to move the mysql socket.

It took another day to search out but, as always, 'The Truth is out there':


The problem is that, although the mysql.default_socket [php.net] config item is NULL by default, the socket location is hard-coded into the Centos .RPM mysql-for-php libraries as /var/lib/mysql.

It seems to my innocent mind that the obvious thing would have been to pick up the location from the my.cnf file(s) but then, what do I know? The PHP developers have now had spats with both the Apache developers *and* the MySQL developers. Well done, chaps.