The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mysql not starting automatically

Discussion in 'General Discussion' started by bloggz, Oct 21, 2006.

  1. bloggz

    bloggz Member

    Joined:
    Jul 20, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I've been having problems with MySQL (4.1) not starting properly on a reboot.

    We're running:
    FC5
    WHM 10.8.0 cPanel 10.9.0-C43
    Fedora i686 - WHM X v3.1.0

    When I SSH in and 'service mysql start' it's fine, starts up and works well.

    Now, having searched the forums and found various references to chkconfig:

    Just wanted to be clear that Mysql is already list on chkconfig:

    chkconfig --list mysql

    and i've already run:

    chkconfig mysql on
    and
    chkconfig --add mysql

    Any ideas?

    (Cheers) ;)
     
    #1 bloggz, Oct 21, 2006
    Last edited: Oct 21, 2006
  2. bloggz

    bloggz Member

    Joined:
    Jul 20, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    bump (help plzkthx) ;)
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Do you have the mysql service correctly ticked in WHM > Service Manager (i.e. in both columns)?
     
  4. bloggz

    bloggz Member

    Joined:
    Jul 20, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Yea, I just checked, both checked (Enable and Monitor), I also tried un-checking them, saving then re-checking them and saving again, reboot, no MySQL start.

    service mysql start

    and its up and running fine

    (Is it normal to have MySQL list on chkconfig as run-level 3, 4 and 5?)
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yes, runlevel 3 4 5 is correct for most application services. You'd only ever be using 3 anyway when running up applications on a web server.

    The other likelihood is if you use a virtual /tmp partition (as created using /scripts/securetmp) as this mounts /tmp as the final boot step in /etc/rc.local. If the original /tmp has the wrong permissions on it (i.e. not 1777) before /scripts/securetmp in /etc/rc.local mounts the secured /tmp partition then MySQL startup will fail.

    There's a few ways round this, choose one of them:

    1. Add the following line to /etc/rc.local at the bottom:

    /etc/init.d/mysql restart

    2. Remove /scripts/securetmp from /etc/rc.local and mount the virtual /tmp partition within fstab instead with a line like:

    /usr/tmpDSK /tmp ext3 loop,noexec,nosuid,nodev 1 0

    You'll then probably want to secure /var/tmp by symlinking it to /tmp:

    umount /var/tmp
    rm -Rfv /var/tmp
    ln -s /tmp /var/tmp


    3. The messiest would be to kill all processes accessing /tmp then umount /tmp and check the permission on the original /tmp directory


    BTW: I always do 2.
     
  6. bloggz

    bloggz Member

    Joined:
    Jul 20, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Hey chirpy, thanks for that, the restart is a bit of a hack but it works fine ;)

    I had a look at the /tmp with your (excellent) ConfigServer Explorer and it was reading as 1777?

    I'm going to try and do it properly tho... (i.e. 2)
     
    #6 bloggz, Oct 23, 2006
    Last edited: Oct 23, 2006
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    If the simply restart in rc.local works for you, then you might as well go with that.
     
  8. bloggz

    bloggz Member

    Joined:
    Jul 20, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Works very well (2), thanks for the help, you are a legend ;)
     
Loading...

Share This Page