[CentOS] MySQL stale socket

Fri Dec 20 07:15:04 UTC 2013
Luigi Rosa <lists at luigirosa.com>

Hash: SHA1

I can confirm that this is a bug added to the latest releases og MySQL.

I tested it only in VM (both VMware and XEN).

How to reproduce.

* start a CentOS VM with MySQL
* abruptly turn the VM off (not shutdown, of course)
* restart VM
* MySQL starts but the connections via /var/lib/mysql/mysql.sock do not work

Jake Shipton said the following on 16/12/2013 11:12:
> On Mon, 16 Dec 2013 10:51:54 +0100 Luigi Rosa <lists at luigirosa.com> wrote:
>> I have a server with a faulty power supply that resets the server every
>> 4/5 hours.
>> While I wait for the supplier to change the PS, I am facing an issue with
>> MySQL.
>> When the system comes back on, mysqld script starts the daemon, but the
>> connections via /var/lib/mysql/mysql.sock don't work because MySQL
>> doesn't delete and recreate the stale socket.
>> Apart from editing /etc/init.d/mysqld to force the deletion of a stale
>> socket are there any other way to solve this issue?
>> Thank you un advance.
>> Ciao, luigi
>> _______________________________________________ CentOS mailing list 
>> CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos
> Hi,
> As a *temporary* solution you could do the following:
> # chkconfig mysqld off # nano /etc/rc.local Add at bottom: rm
> /var/lib/mysql/mysql.sock service mysqld start Now Save.
> Next time the machine boots it should remove the sock file, and then start
> mysqld.
> Once your PSU is fixed, remove those lines and run:
> # chkconfig mysqld on
> Job done! :-D
> Hope this helps.
> Kind Regards, Jake Shipton (JakeMS) GPG Key: 0xE3C31D8F GPG Fingerprint:
> 7515 CC63 19BD 06F9 400A DE8A 1D0B A5CF E3C3 1D8F 
> _______________________________________________ CentOS mailing list 
> CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos


- -- 
+--[Luigi Rosa]--

  We don't need no indirection
  We don't need no flow control
  No data typing or declarations
  Did you leave those lists alone
  Hey! Hacker! Leave those lists alone!
  All in all, it's just a pure-Lisp function call
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/