mysql fails to start on boot but starts ok on second reboot

Discussion in 'General' started by orasis, Dec 13, 2013.

  1. orasis

    orasis Member

    This is a debian wheezy x64 new system. After having the server working online for days or weeks, in case I want to reboot it, it "sometimes" fails to start mysql server. It happened about 3 times now and all I have done is login and reboot again. This time though mysql starts normally. Generally the machine works excellent and very fast on new hardware x64 on i7 with 8gb ram. I haven't noticed anything going wrong so far.

    Any idea what could be causing this ?
    Thanks in advance for all help.
     
  2. vijay.pratap

    vijay.pratap New Member

    replace your /etc/my.cnf with my-huge.cnf.
     
  3. orasis

    orasis Member

    Thanks dude, I have done that and everything looks ok. Even after reboot I got no problem. Lets see.

    Any setting you would also tweak regarding the ram I have on this machine ?
    Cheers, thansk for your help.

    EDIT:
    I should mention that the paths on debian are different. This is the procedure I followed:

    Code:
    cd /tmp
    cp /usr/share/doc/mysql-server-5.5/examples/my-huge.cnf.gz /tmp/
    gunzip my-huge.cnf.gz
    
    #### Backup the existing first
    cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
    
    #### ..and replace the original
    cp /tmp/my-huge.cnf /etc/mysql/my.cnf
    rm /tmp/my-huge.cnf
    
    #### Restart mysql
    service mysql restart
    
    #### If something goes wrong put back the original and restart mysql again
    cp /etc/mysql/my.cnf.bak /etc/mysql/my.cnf
    service mysql restart
    
    Also, there is no need to worry about the edit done in /etc/mysql/my.cnf in this tutorial on page 3: http://www.howtoforge.com/perfect-server-debian-wheezy-apache2-bind-dovecot-ispconfig-3-p3 once the bind-address setting doesn't exist in my-huge.cnf
     
    Last edited: Dec 14, 2013
  4. orasis

    orasis Member

    Hello again,

    I think I got a problem here.
    See what happened during the upgrade to the new mysql version.
    This is the exact series of actions as they took place:

    Code:
    Hit http://ftp.gr.debian.org wheezy Release.gpg
    Hit http://ftp.gr.debian.org wheezy-updates Release.gpg                                    
    Hit http://ftp.gr.debian.org wheezy Release                                                
    Hit http://ftp.gr.debian.org wheezy-updates Release                                                              
    Hit http://ftp.gr.debian.org wheezy/main Sources                                                            
    Hit http://security.debian.org wheezy/updates Release.gpg                    
    Hit http://ftp.gr.debian.org wheezy/contrib Sources                          
    Hit http://security.debian.org wheezy/updates Release                        
    Hit http://ftp.gr.debian.org wheezy/non-free Sources                         
    Hit http://security.debian.org wheezy/updates/main Sources                   
    Hit http://ftp.gr.debian.org wheezy/main amd64 Packages                      
    Hit http://security.debian.org wheezy/updates/contrib Sources                
    Hit http://ftp.gr.debian.org wheezy/contrib amd64 Packages                   
    Hit http://security.debian.org wheezy/updates/non-free Sources               
    Hit http://ftp.gr.debian.org wheezy/non-free amd64 Packages                  
    Hit http://security.debian.org wheezy/updates/main amd64 Packages            
    Hit http://ftp.gr.debian.org wheezy/contrib Translation-en                   
    Hit http://security.debian.org wheezy/updates/contrib amd64 Packages         
    Hit http://ftp.gr.debian.org wheezy/main Translation-en                      
    Hit http://security.debian.org wheezy/updates/non-free amd64 Packages        
    Hit http://ftp.gr.debian.org wheezy/non-free Translation-en                  
    Hit http://security.debian.org wheezy/updates/contrib Translation-en         
    Hit http://ftp.gr.debian.org wheezy-updates/main Sources                     
    Hit http://security.debian.org wheezy/updates/main Translation-en            
    Hit http://ftp.gr.debian.org wheezy-updates/contrib Sources                  
    Hit http://security.debian.org wheezy/updates/non-free Translation-en        
    Hit http://ftp.gr.debian.org wheezy-updates/non-free Sources                 
    Hit http://ftp.gr.debian.org wheezy-updates/main amd64 Packages/DiffIndex
    Hit http://ftp.gr.debian.org wheezy-updates/contrib amd64 Packages
    Hit http://ftp.gr.debian.org wheezy-updates/non-free amd64 Packages
    Hit http://ftp.gr.debian.org wheezy-updates/contrib Translation-en
    Hit http://ftp.gr.debian.org wheezy-updates/main Translation-en/DiffIndex
    Hit http://ftp.gr.debian.org wheezy-updates/non-free Translation-en
    Reading package lists... Done 
    
    Code:
    # apt-get upgrade
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be upgraded:
      libmysqlclient-dev libmysqlclient18 mysql-client mysql-client-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5
    8 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Need to get 9,621 kB of archives.
    After this operation, 73.7 kB disk space will be freed.
    Do you want to continue [Y/n]? y
    Get:1 http://security.debian.org/ wheezy/updates/main mysql-common all 5.5.33+dfsg-0+wheezy1 [80.3 kB]
    Get:2 http://security.debian.org/ wheezy/updates/main mysql-server all 5.5.33+dfsg-0+wheezy1 [78.6 kB]
    Get:3 http://security.debian.org/ wheezy/updates/main mysql-server-5.5 amd64 5.5.33+dfsg-0+wheezy1 [2,094 kB]
    Get:4 http://security.debian.org/ wheezy/updates/main mysql-client all 5.5.33+dfsg-0+wheezy1 [78.4 kB]
    Get:5 http://security.debian.org/ wheezy/updates/main mysql-client-5.5 amd64 5.5.33+dfsg-0+wheezy1 [1,883 kB]
    Get:6 http://security.debian.org/ wheezy/updates/main mysql-server-core-5.5 amd64 5.5.33+dfsg-0+wheezy1 [3,778 kB]
    Get:7 http://security.debian.org/ wheezy/updates/main libmysqlclient-dev amd64 5.5.33+dfsg-0+wheezy1 [949 kB]                                                                                                                                                                 
    Get:8 http://security.debian.org/ wheezy/updates/main libmysqlclient18 amd64 5.5.33+dfsg-0+wheezy1 [680 kB]                                                                                                                                                                   
    Fetched 9,621 kB in 8s (1,150 kB/s)                                                                                                                                                                                                                                           
    Reading changelogs... Done
    apt-listchanges: Mailing root: apt-listchanges: news for xxxxxxxxxxxxxxxxxx.net
    Preconfiguring packages ...
    (Reading database ... 55609 files and directories currently installed.)
    Preparing to replace mysql-common 5.5.31+dfsg-0+wheezy1 (using .../mysql-common_5.5.33+dfsg-0+wheezy1_all.deb) ...
    Unpacking replacement mysql-common ...
    Preparing to replace mysql-server 5.5.31+dfsg-0+wheezy1 (using .../mysql-server_5.5.33+dfsg-0+wheezy1_all.deb) ...
    Unpacking replacement mysql-server ...
    Setting up mysql-common (5.5.33+dfsg-0+wheezy1) ...
    (Reading database ... 55611 files and directories currently installed.)
    Preparing to replace mysql-server-5.5 5.5.31+dfsg-0+wheezy1 (using .../mysql-server-5.5_5.5.33+dfsg-0+wheezy1_amd64.deb) ...
    [ ok ] Stopping MySQL database server: mysqld.
    [ ok ] Stopping MySQL database server: mysqld.
    Unpacking replacement mysql-server-5.5 ...
    Preparing to replace mysql-client 5.5.31+dfsg-0+wheezy1 (using .../mysql-client_5.5.33+dfsg-0+wheezy1_all.deb) ...
    Unpacking replacement mysql-client ...
    Preparing to replace mysql-client-5.5 5.5.31+dfsg-0+wheezy1 (using .../mysql-client-5.5_5.5.33+dfsg-0+wheezy1_amd64.deb) ...
    Unpacking replacement mysql-client-5.5 ...
    Preparing to replace mysql-server-core-5.5 5.5.31+dfsg-0+wheezy1 (using .../mysql-server-core-5.5_5.5.33+dfsg-0+wheezy1_amd64.deb) ...
    Unpacking replacement mysql-server-core-5.5 ...
    Preparing to replace libmysqlclient-dev 5.5.31+dfsg-0+wheezy1 (using .../libmysqlclient-dev_5.5.33+dfsg-0+wheezy1_amd64.deb) ...
    Unpacking replacement libmysqlclient-dev ...
    Preparing to replace libmysqlclient18:amd64 5.5.31+dfsg-0+wheezy1 (using .../libmysqlclient18_5.5.33+dfsg-0+wheezy1_amd64.deb) ...
    Unpacking replacement libmysqlclient18:amd64 ...
    Processing triggers for man-db ...
    Setting up mysql-client-5.5 (5.5.33+dfsg-0+wheezy1) ...
    Setting up mysql-server-core-5.5 (5.5.33+dfsg-0+wheezy1) ...
    Setting up mysql-server-5.5 (5.5.33+dfsg-0+wheezy1) ...
    [ ok ] Stopping MySQL database server: mysqld.
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing mysql-server-5.5 (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of mysql-server:
     mysql-server depends on mysql-server-5.5; however:
      Package mysql-server-5.5 is not configured yet.
    
    dpkg: error processing mysql-server (--configure):
     dependency problems - leaving unconfigured
    Setting up mysql-client (5.5.33+dfsg-0+wheezy1) ...
    Setting up libmysqlclient18:amd64 (5.5.33+dfsg-0+wheezy1) ...
    Setting up libmysqlclient-dev (5.5.33+dfsg-0+wheezy1) ...
    Errors were encountered while processing:
     mysql-server-5.5
     mysql-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    
    Code:
    # service mysql restart
    [ ok ] Stopping MySQL database server: mysqld.
    [....] Starting MySQL database server: mysqld . . . . . . . . . . .Killed
    
    Code:
    # apt-get upgrade
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    2 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Setting up mysql-server-5.5 (5.5.33+dfsg-0+wheezy1) ...
    [ ok ] Stopping MySQL database server: mysqld.
    [....] Starting MySQL database server: mysqld . . . ./usr/sbin/invoke-rc.d: line 512:  5950 Killed                  "${INITDPREFIX}${INITSCRIPTID}" "${saction}" "[email protected]"
    invoke-rc.d: initscript mysql, action "start" failed.
    Setting up mysql-server (5.5.33+dfsg-0+wheezy1) ...
    
    Code:
    # service mysql restart
    [ ok ] Stopping MySQL database server: mysqld.
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
    
    # service mysql restart
    [ ok ] Stopping MySQL database server: mysqld.
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
    
    # service mysql restart
    [ ok ] Stopping MySQL database server: mysqld.
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
    
    Code:
    # cp /etc/mysql/my.cnf.bak /etc/mysql/my.cnf
    # service mysql restart
    [ ok ] Stopping MySQL database server: mysqld.
    [ ok ] Starting MySQL database server: mysqld ..
    [info] Checking for tables which need an upgrade, are corrupt or were 
    not closed cleanly..
    
    After that I rebooted the machine and failed to start mysql again.
    Then I rebooted again and mysql started.

    Now all this while mysql really delays to start while it is printing those dots (.)

    Any ideas what to check please ?
    thanks

    EDIT:
    While watching how mysql performs on a CMS such as Joomla I see the CPU for mysql moving from 0.7% to 1.0%
    If I do the same on Piwik analytics it does not raise any higher than 1.7%
    Generally it feels very fast. But I am worried about those fails.
     
    Last edited: Dec 17, 2013

Share This Page