It turned out that when they rebooted their LAMP server, the mysql demon didn't turn on with the rest of the services like the apache http demon. Luckily, this is easy to fix. I ssh'd to their server and got to work.
First, I checked to see if my hunch was right:
mysqladmin ping
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
Yipes! Yup, you have no bananas (or mysql, as the case my be).
Next, I ran the mysql initialization script:
/etc/init.d/mysqld start
Starting MySQL: [ OK ]
Then check to see if it worked:
mysqladmin ping
mysqld is alive
Ah, yes. All better!
Next time, we can make mysql demon startup at boot time. On a Red Hat type system you can run the following code as root (or via sudo) to run the initialization script automatically at boot:
ln -s /etc/rc.d/init.d/mysqld /etc/rc.d/rc3.d/S98mysql
No comments:
Post a Comment