Portal Home > Knowledgebase > Articles Database > ERROR! MySQL server PID file could not be found!


ERROR! MySQL server PID file could not be found!




Posted by Kotsolis, 05-12-2015, 04:15 PM
Hello, my site had very slow response. Pages weren't loading completelly. I tried to restart mysql server...nothing So I did a restart, a Graful and FOrceful, but MySQL server couldn't load again. What should I do?

Posted by vanmorrison, 05-12-2015, 04:50 PM
you may want to check http://www.webhostingtalk.com/showthread.php?t=1424779

Posted by ImpressHost, 05-12-2015, 04:51 PM
Did you check /var/lib/mysql/hostname.err file? Can you paste the error?

Posted by Kotsolis, 05-12-2015, 05:13 PM
Some more info before I answer the questions. In error logs I see this. This is when the error started. Cpanel also says this when I try to go to mysql database. The MySQL server is currently offline. Error while connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Error while connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/cpanel/Cpanel/Mysql.pm line 164. About "Did you check /var/lib/mysql/hostname.err file? Can you paste the error?" How can I paste the error? Please give me exact commands as Iam not that familiar with SSH.

Posted by iserversupport, 05-12-2015, 05:20 PM
try tail -20 /var/lib/mysql/hostname.err, make sure to replace hostname with the hostname of your server

Posted by Kotsolis, 05-12-2015, 05:23 PM
root@209703 [/var/lib/mysql]# tail -20 /var/lib/mysql/hostname.err tail: cannot open `/var/lib/mysql/hostname.err' for reading: No such file or directory

Posted by selinux, 05-12-2015, 05:24 PM
check the disk space on the server that can be a problem that would stop mysql from starting. df -h see if / is 100% also do a "touch test" to make sure the disk is read write and not read only mode.

Posted by Kotsolis, 05-12-2015, 07:22 PM
I think my hard drive with the md1 partition needs replacement. What do you think? May 13 01:00:08 209703 kernel: res 41/40:00:b0:00:43/00:00:02:00:00/40 Emask 0x409 (media error) May 13 01:00:08 209703 kernel: ata1.00: status: { DRDY ERR } May 13 01:00:08 209703 kernel: ata1.00: error: { UNC } May 13 01:00:08 209703 kernel: ata1.00: configured for UDMA/133 May 13 01:00:08 209703 kernel: ata1: EH complete May 13 01:00:09 209703 kernel: ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0 May 13 01:00:09 209703 kernel: ata1.00: irq_stat 0x40000008 May 13 01:00:09 209703 kernel: ata1.00: failed command: READ FPDMA QUEUED May 13 01:00:09 209703 kernel: ata1.00: cmd 60/08:00:af:00:43/00:00:02:00:00/40 tag 0 ncq 4096 in May 13 01:00:09 209703 kernel: res 41/40:00:b0:00:43/00:00:02:00:00/40 Emask 0x409 (media error) May 13 01:00:09 209703 kernel: ata1.00: status: { DRDY ERR } May 13 01:00:09 209703 kernel: ata1.00: error: { UNC } May 13 01:00:09 209703 kernel: ata1.00: configured for UDMA/133 May 13 01:00:09 209703 kernel: sd 0:0:0:0: [sda] Unhandled sense code May 13 01:00:09 209703 kernel: sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE May 13 01:00:09 209703 kernel: sd 0:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor] May 13 01:00:09 209703 kernel: Descriptor sense data with sense descriptors (in hex): May 13 01:00:09 209703 kernel: 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 May 13 01:00:09 209703 kernel: 02 43 00 b0 May 13 01:00:09 209703 kernel: sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed root@209703 [/var/lib/mysql]# cat /proc/mdstat Personalities : [raid1] md1 : active raid1 sda1[0] 40965632 blocks [2/1] [U_] md2 : active raid1 sda2[0] sdb2[1] 513984 blocks [2/2] [UU] md5 : active raid1 sda5[0] sdb5[1] 2104384 blocks [2/2] [UU] md6 : active raid1 sda6[0] sdb6[1] 443747328 blocks [2/2] [UU] All I needed was a cat /proc/mdstat . smartctl wasn't working and I hadn't checked my hard drives for more than 1 year! iserversupport helped immediatelly. Thanks.

Posted by selinux, 05-12-2015, 07:48 PM
Glad it was fixed.

Posted by net, 05-12-2015, 07:51 PM
You should always monitor your raid. You are lucky both drives didn't fail at the same time or you will lose all your data.

Posted by SneakySysadmin, 05-12-2015, 08:33 PM
Actually it's worse than that - not only are you not monitoring your RAID, but mdadm itself can notify you of events. In fairness, not everyone already knows that I suppose :p Take your favorite text editor to /etc/mdadm/mdadm.conf. It might also be /etc/mdadm.conf - just depends on your certain flavor of linux. Add/modify line like so: Your service reload/restart command format may be different - adjust accordingly. Note that the mdadm service is the monitoring service, not the actual array - so reloading the process isn't going to hurt anything. If the state changes, the mdadm daemon will send an email to the listed address notifying you of the change. This doesn't mean you shouldn't monitor it also - but you can never have too many watchdogs on something as important as your RAID status.

Posted by Kotsolis, 05-12-2015, 09:10 PM
Right now I backup my data from 12/5/15 just to be sure. In 5 hours from now I will open a Support ticket to have my hard drive replaced. Question 1 I will copy-paste all these logs. But what exactly should I write in the description? Which of these is correct? A)"Replace my faulty hard drive and be careful to keep all the data" ? B)"Replace my faulty hard drive and put the data from the old hard drive to the new one" ? or C)"Replace my faulty hard drive and take the data from the other hard drive" ? Question 2 I don't know exactly how RAID system works and how the 2 hard drives co-operate. If some can give a more in depth analysis, it would be great. For example in how many hours does the first hard drive copy data to the 2nd one? Has it coppied corrupted mysql tables right now? Question 3 Is it any chance that I lose mysql data? These mysql errors will be transferred to the new hard drive as well or everything will be fine and taken from the working hard drive? I just ask all these stuff so that I know if I have to load any older backup data. I have disabled the Backup from WHM so now I have 2 zip backups, from 11/5/15 and 12/5/15. Iam dowloading the one taken at 12/5/15. Please respond with some answers to the above. Again thank you all for helping. I just hope QHoster.com will respond immediately when I post the ticket, and replace the hard drive as the site is down for many hours!

Posted by SneakySysadmin, 05-12-2015, 10:02 PM
D) None of the Above Try instead: Make *sure* you have a good, up-to-date- backup first. The nice thing about RAID is that it will take care of synching the existing data to the new drive. Your colo will physically swap out the bad drive (which may require a shutdown), put in the new drive in, and tell mdadm to add the new drive to the existing array. The RAID software will do the rest. Corrupted MySQL tables will still be corrupted. That is a separate issue entirely. How many hours the rebuild takes depends entirely on how fast your disks are and how much data needs to be shuffled around. The disk is usable during this time, but there will be high load and things will be sluggish until the rebuild is complete. You will not lose any data you haven't already lost. RAID is not there to keep your data from corrupting itself. One disk just mirrors the other. If you have bad data, you have bad data on both drives. Repairing your MySQL tables is for after you replace the disk though.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
I/O Speed Command? (Views: 626)
Phonenix Node Outage (Views: 729)

Language: