Friday, May 1, 2009

Restarting MySql in FreeBSD Unix

How to start mysql in free bsd unix.

Okay, for you unix geeks out there, this is elementary information and "no duh" but for other people that are new to it, I figured I would post this tutorial.

I recently ran into a problem with my unix box running out of disk space and causing mysql to crash. The symptoms were basically that I could no longer hold sessions or log-in to my hosted website that we built. However, queries of the mysql server from php webpages were still working.

Anyhow, I cleaned up some disk space and rebooted the box, and now mysql was completely shut down, I could not get my php webpages to load. I looked into the system and ran the 'top' command in unix and noticed that mysqld was not started on the box.

So, I was trying to find out how to restart mysql in bsd and could not find a simple command anywhere.

This is what worked for me ultimately:

Go to the directory that stores mysql, for me, it meant navigating to
/var/db/mysql
then simply type: mysqld_safe

That should start up mysqld

Note: when I was trying to start it without the _safe portion tacked to it, like "start mysql" I would get a socket error telling, so the mysqld_safe is the way to go.

No comments: