MySQL Job failed to start

后端 未结 13 1919
离开以前
离开以前 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:36

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

    sudo mkdir /home//mysql/
    cd /var/lib/mysql/
    sudo cp * /home//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.

提交回复
热议问题