Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jun 2006
    Posts
    9

    Default Fresh Install: MySQL Fails on boot, but succeeds on restart

    Hello all, thank you for your help in the past, andd thank you in advance for taking the time to help with this latest problem.

    On two seperate servers I have the same problem, both are running RHEL 3. I install CPanel using layer1.cpanel.net/latest, everything works great, and then eventually I reboot my server. While booting, mysql fails to start, but after booting, I can log in and run /scripts/restartsrv_mysql and mysql starts up without a problem.

    So, I guess the question is, what does /scripts/restartsrv_mysql do right that /etc/init.d/mysql does wrong, and how can I fix that? I tried looking at the various scripts, and determined that one problem might be that the /etc/init.d/mysql script does not specify a basedir, but I have no idea what that basedir should be, since I don't even find a basedir line in Cpanel's script.

    I thought maybe the problem was that mysql was starting too early, but when I upped its number in rc3.d it still failed, albeit later in the boot process.

    Any insights into the problem would be appreciated.

    Thanks,
    - Geddes

  2. #2
    Member Rafaelfpviana's Avatar
    Join Date
    Mar 2004
    Location
    Brazil
    Posts
    142

    Default

    Well, first of all I recommend that you put this in your /etc/my.cnf

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    That way you will know if the server is trying to start mysql and if something happens in the process.

    Next, check if mysql is in chkconfig, to check do this:

    root@server [~]# chkconfig --list|grep mysql
    mysql 0: off 1: off 2: on 3: on 4: on 5: on 6: off
    If you don't get a result like mine you can add mysql in chkconfig like this:
    root@server [~]# chkconfig --add mysql
    Then add the runlevels to be checked if mysql stared and if it isn't running it will try to start it.
    root@server [~]# chkconfig --level 2345 mysql on
    Next time you reboot the server take a look the the log in /var/log/mysqld.log and if something went wrong you will know.

    Hope I helped you out.
    Have a good day.
    Last edited by Rafaelfpviana; 07-21-2006 at 08:10 AM.
    ..........*...*
    ......*......... *
    ....*...........0/
    ....RJHOST./||
    ................/ \

    RJHost Hospedagem 5 Estrelas *****
    www.RJHost.com.br - Hospedagem de Sites

    Registro de domínios .com.br a R$ 45, e .com a partir de R$ 38,00 - www.E-Registros.com.br

    ScriptFacil.cOm - A melhor em JavaScript - Tudo para o seu site. - www.ScriptFacil.cOm

    Personal site adn Blog - visit: www.rafaelfpviana.com

  3. #3
    Member
    Join Date
    Jun 2006
    Posts
    9

    Default

    Thanks for your help, looking at the log showed that on boot mysql was having problems writing to /tmp

    Then i looked at my fstab to find that cpanel had deleted my /tmp! Then I looked at local.rc, and found that cpanel runs a script called /scripts/securetmp that creates one on the fly on booting, but in rc3 it runs as S99, which is after mysql, which was at S64, and thus the problem. To fix, I just removed mysql from rc3.d and put the start command in the rc.local after the securetmp had been set up.

    - Geddes

  4. #4
    Member
    Join Date
    Apr 2004
    Location
    Vancouver BC Canada
    Posts
    30

    Default

    I Am Having Same Problem Could You Show Me Exactly What You Did To Fix It??

  5. #5
    Registered User
    Join Date
    May 2007
    Posts
    2

    Default

    I just read this and it worked for me. The exact commands are like this.

    rm /etc/rc3.d/S64mysql

    vi /etc/rc.local

    (add this line to the bottom of the file)
    /etc/init.d/mysql start

    (save and exit with this command)
    :wq

    Then reboot

  6. #6
    Registered User
    Join Date
    May 2007
    Posts
    2

    Default

    After doing this, cpanel still would not start on boot so I did the same with the cpanel startup script.

    rm /etc/rc3.d/S95cpanel

    vi /etc/rc.local

    (add this line)
    /etc/init.d/cpanel start

    (save)
    :wq

    restart.

Similar Threads & Tags
Similar threads

  1. No MySQL on RHEL 6 (x64) - Fresh install
    By Pieter Borst in forum Database Discussions
    Replies: 7
    Last Post: 03-07-2011, 02:16 PM
  2. MySQL won't start [fresh install]
    By HeSWeB in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-03-2008, 07:54 AM
  3. httpd fails to restart after install ssl certificate
    By fcitrolo in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-01-2006, 09:57 PM
  4. Restoring MYSQL databases from Fresh install
    By eter4 in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 07-22-2006, 09:58 PM
  5. Fresh install - MySQL Borked
    By xWho in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 12-18-2003, 06:04 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube