MySQL Job failed to start

后端 未结 13 1833
离开以前
离开以前 2021-01-30 14:40

I\'m on Kubuntu 12.04, and after installing mysql via an apt-get (mysql ver: 5.5.35), i\'m trying to start mysql service, but I got this error:

sudo servi

相关标签:
13条回答
  • 2021-01-30 15:31

    My problem was running out of memory. Digital ocean has great instruction for adding swap memory for Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

    This solved the issue and enabled me to restart the Mysql that otherwise would not start.

    0 讨论(0)
  • 2021-01-30 15:33

    To help others who do not have a full disk to troubleshoot this problem, first inspect your error log (for me the path is given in my /etc/mysql/my.cnf file):

    tail /var/log/mysql/error.log
    

    My problem turned out to be a new IP address allocated after some network router reconfiguration, so I needed to change the bind-address variable.

    0 讨论(0)
  • 2021-01-30 15:34

    I had the same problem. But i discover that my hd is full.

    $ sudo cat /var/log/upstart/mysql.log
    /proc/self/fd/9: ERROR: The partition with /var/lib/mysql is too full!
    

    So, I run

    $ df -h
    

    And I got the message

    /dev/xvda1      7.8G  7.4G     0 100% /
    

    Then I found out which folder was full by running the following command on the terminal

    $ cd /var/www
    $ for i in *; do echo $i; find $i |wc -l; done
    

    This give me the number of files on each folder on /var/www. I logged into the folder with most files, and deleted some backup files, and i continued deleting useless files and cache files.

    then I run $ sudo /etc/init.d/mysql start and it work again

    0 讨论(0)
  • 2021-01-30 15:36

    First make a backup of your /var/lib/mysql/ directory just to be safe.

    sudo mkdir /home/<your username>/mysql/
    cd /var/lib/mysql/
    sudo cp * /home/<your username>/mysql/ -R
    

    Next purge MySQL (this will remove php5-mysql and phpmyadmin as well as a number of other libraries so be prepared to re-install some items after this.

    sudo apt-get purge mysql-server-5.1 mysql-common
    

    Remove the folder /etc/mysql/ and it's contents

    sudo rm /etc/mysql/ -R
    

    Next check that your old database files are still in /var/lib/mysql/ if they are not then copy them back in to the folder then chown root:root

    (only run these if the files are no longer there)

    sudo mkdir /var/lib/mysql/
    sudo chown root:root /var/lib/mysql/ -R
    cd ~/mysql/
    sudo cp * /var/lib/mysql/ -R
    

    Next install mysql server

    sudo apt-get install mysql-server
    

    Finally re-install any missing packages like phpmyadmin and php5-mysql.

    0 讨论(0)
  • 2021-01-30 15:37

    This line did solve the issue in my case,

    sudo apt clean
    
    0 讨论(0)
  • 2021-01-30 15:38

    In my case the problem was the /var/log disk full (check with df -h)

    Just deleted some log files and mysql started, no big deal!

    0 讨论(0)
提交回复
热议问题