[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Mysql question



> Hi all
> I recently set up mysql and php3 on my raq 3 using the files from raq. all
> worked ok for a couple of weeks. Until now, when i typt mysql i get
>  [admin@dns httpd]$ ERROR 2002: Can't connect to local MySQL server
through
> socket '/var/lib/mysql/mysql.sock' (111)
>
> any ideas ? i am not to good with linux or mysql. I noticed that whan i
run
> TOP safemysql which is usually running is not there. i tried a re boot
still
> no go.#
> I looked through my error log but could no see anything. Any help would be
> great


Andy,

MySQL is not automatically started at boot, unless you tell it to in one of
your init scripts.

Depending on what version you have installed and where you installed it, one
of the following commands (with minor path modifications as necessary) will
get MySQL up and running once again from an already running server.

/usr/local/mysql/bin/safe_mysqld > /dev/null &

/usr/local/mysql/share/mysql/mysql.server start > /dev/null &

If you have the 'mysql.server' script, I would recommend using that one in
your init scripts.  I have, however, run into problems using it to start
MySQL on an already running server.

To have MySQL start upon bootup/reboot, simply place one of the above
commands into an init script (less the '&').  I put it at the bottom of my
rc.local init script (/etc/rc.d/rc.local on RHL 6.1), so it looks like this:

# MySQL Server
/usr/local/mysql/share/mysql/mysql.server start > /dev/null

You should also read the MySQL docs on how to run MySQL as a non-privileged
user:

http://www.mysql.com/php/manual.php3?section=Automatic_start

Note that if you change the user that MySQL runs as, make sure it has access
to all the necessary files under the new username (ie. chown all MySQL db
files in the <mysql_path>/var/ dir to the user you wish it to run as).  The
MySQL docs contain much more info than I have provided...definitely worth
the lengthy read.

BC