Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Job failed to start

Tags:

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 service mysql start

start: Job failed to start

So I googled this problem, it says i have to go to the /var/log/mysql/error.log

But my error.log file is empty :(

Then I checked the permissions :

drwxr-s--- 2 mysql adm 4096 Apr 7 11:21 mysql

-rw-r----- 1 mysql adm 0 Apr 7 11:21 error.log

So I don't know what to do... Why this error ? Why is the error file empty ?

like image 821
Alfred Avatar asked Apr 07 '14 09:04

Alfred


People also ask

How fix MySQL is not starting?

Fixing the MySQL server not starting in XAMPP is done by reverting back the data files pre-issue. Navigate to your XAMPP MySQL directory ( C:\xampp\mysql ). Create a new folder called FIX_BACKUP . Copy C:\xampp\mysql\backup and C:\xampp\mysql\data into C:\xampp\mysql\FIX_BACKUP .

Why is MySQL server not working?

normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.


1 Answers

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.

like image 193
Rajesh Avatar answered Nov 07 '22 19:11

Rajesh