Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I am running ubuntu server. When I tried to login to mysql(which was running),I got the following error

ERROR 2002 (HY000): Can't connect to local MySQL server through socket         '/var/run/mysqld/mysqld.sock' (2)

But mysqld.sock file doesn't exist inside /var/run/mysqld folder. On executing ps aux | grep mysql command,I realized that mysql server was not running.

I then tried to restart mysql server using

service mysql start
service mysql restart
/etc/init.d/mysql start

But,the start process failed in all 3 cases. /var/log/mysql/mysql.log and /var/log/mysql/mysql.err files are empty.

But /var/log/error.log shows following information:

140425 12:49:05 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140425 12:49:05 [Note] Plugin 'FEDERATED' is disabled.
140425 12:49:05 InnoDB: The InnoDB memory heap is disabled
140425 12:49:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140425 12:49:05 InnoDB: Compressed tables use zlib 1.2.8
140425 12:49:05 InnoDB: Using Linux native AIO
140425 12:49:05 InnoDB: Initializing buffer pool, size = 3.0G
140425 12:49:05 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 26214400 bytes!
140425 12:49:05 [ERROR] Plugin 'InnoDB' init function returned error.
140425 12:49:05 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140425 12:49:05 [ERROR] /usr/sbin/mysqld: unknown variable 'record_buffer=64M'
140425 12:49:05 [ERROR] Aborting

140425 12:49:05 [Note] /usr/sbin/mysqld: Shutdown complete
share|improve this question
see if this helps:… – Rinzwind Apr 25 '14 at 7:35
What is the output of ls /var/lib/mysql/ib_logfile*? – i08in Apr 25 '14 at 7:40
ls: cannot access /var/lib/mysql/ib_logfile*: No such file or directory – ananth Apr 25 '14 at 7:46
Is your /var/lib/mysql directory writable for mysql? – Jos Apr 25 '14 at 8:10
I am a linux newbie..I changed the permissions of /var/lib/mysql by using chmod 777 . Can you please suggest me how to check if this is not the right way? – ananth Apr 25 '14 at 8:27

6 Answers 6

Open a terminal(Ctrl+Alt+t) and do the following:

sudo service mysql stop
sudo rm /var/lib/mysql/ib_logfile0
sudo rm /var/lib/mysql/ib_logfile1

and comment out the line record_buffer=64M in /etc/mysql/my.cnf [1]

and then restart msyql using:

sudo service mysql restart


share|improve this answer
I ran the commands you mentioned..On running sudo service mysql restart, it gave a message stop: Unknown instance and shell prompt didn't appear(restart is still running from past 50 mins) – ananth Apr 25 '14 at 9:30
Also, now the error log says: -140425 15:09:11 InnoDB: highest supported file format is Barracuda. 140425 15:09:12 InnoDB: Waiting for the background threads to start 140425 15:09:13 InnoDB: 5.5.37 started; log sequence number 940942258188 140425 15:09:13 [ERROR] /usr/sbin/mysqld: unknown variable 'record_buffer=64M' 140425 15:09:13 [ERROR] Aborting 140425 15:09:13 InnoDB: Starting shutdown... 140425 15:09:14 InnoDB: Shutdown completed; log sequence number 940942258188 140425 15:09:14 [Note] /usr/sbin/mysqld: Shutdown complete – ananth Apr 25 '14 at 9:45
No..I did sudo service mysql restart. – ananth Apr 25 '14 at 9:49
Can you try doing sudo service mysql start? – i08in Apr 25 '14 at 9:50
this works for me, thanks! – cwhsu Oct 22 '14 at 6:33

I solved the problem in the following way:

chown -R mysql:mysql /var/lib/mysql
mysql_install_db --user=mysql -ldata=/var/lib/mysql/
share|improve this answer

Remove the file /var/lib/mysql/.run-mysql_upgrade and it should start


"With great power comes great responsibility"

share|improve this answer

I had the same error message and the same emptyness in the log files. In my config-file (my.cnf) I had specified that I wanted to use myisam tables, by adding this line in the [mysqld]-section:

default-table-type = myisam

After upgrading mysql it seems this causes mysql not to start. I have changed this to:

default-storage-engine = myisam

and now everything works fine.

share|improve this answer

This solved my problem:

mkdir /var/run/mysqld

touch /var/run/mysqld/mysqld.sock

chown -R mysql /var/run/mysqld

/etc/init.d/mysql restart

share|improve this answer

it should work

chmod 1777 /tmp

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.