Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a VPS with ChicagoVPS that's running Centos 6. Official version of the build is:

Linux RedHat 6.5(Final 2.6.32-042stab078.26 x86_64)

I followed this guide to add the repository and installed MySQL 5.6.15.

It installed with no errors. The following error is the one that I get whenever I try to access the database:

[root@sacroiliac log]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

These are the commands I'm running. (I'm also adding the mysql portion because I read somewhere the daemon was changed from mysqld to mysql, but it's not being found on my system.)

[root@sacroiliac log]# service mysqld start
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]
[root@sacroiliac log]# service mysql start
mysql: unrecognized service
[root@sacroiliac log]# /etc/init.d/mysql start
-bash: /etc/init.d/mysql: No such file or directory
[root@sacroiliac log]# /etc/init.d/mysqld start
MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]

There is no error file in /var/lib/mysql/ and /var/log/mysqld.log says the following:

131210 17:34:04 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
131210 17:34:04 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
131210 17:34:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
131210 17:34:21 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

There is MySQL 5.1 on the default repository, but I'd like 5.6 for full-text search of InnoDB databases, and the new(er) SHA2 algorithms.

Edit
Also, I wanted to note that I have rebuilt the VM a few times (eliminate the issue of having a corrupt download), and Googled the issue. None of the results I've found have been helpful at all. Most of them were actually unanswered questions similarly to mine.

Edit 2
/var/log/messages contains the following:

Dec 10 17:32:10 sacroiliac yum[1327]: Installed: mysql-community-release-el6-5.noarch
Dec 10 17:32:45 sacroiliac yum[1328]: Installed: mysql-community-common-5.6.15-1.el6.x86_64
Dec 10 17:32:46 sacroiliac yum[1328]: Installed: mysql-community-libs-5.6.15-1.el6.x86_64
Dec 10 17:32:51 sacroiliac yum[1328]: Installed: mysql-community-client-5.6.15-1.el6.x86_64
Dec 10 17:32:51 sacroiliac yum[1328]: Installed: libaio-0.3.107-10.el6.x86_64
Dec 10 17:33:04 sacroiliac yum[1328]: Installed: mysql-community-server-5.6.15-1.el6.x86_64
Dec 10 17:34:04 sacroiliac kernel: [627203.702793] OOM killed process 1657 (mysqld) vm:385760kB, rss:238984kB, swap:0kB
Dec 10 17:34:21 sacroiliac kernel: [627220.208520] OOM killed process 1919 (mysqld) vm:385760kB, rss:238300kB, swap:0kB
Dec 10 17:50:03 sacroiliac kernel: [628160.758387] OOM killed process 2228 (mysqld) vm:385760kB, rss:238988kB, swap:0kB
Dec 10 17:51:33 sacroiliac kernel: [628250.613146] OOM killed process 2486 (mysqld) vm:385760kB, rss:237220kB, swap:0kB
Dec 10 17:51:49 sacroiliac kernel: [628266.621825] OOM killed process 2744 (mysqld) vm:385760kB, rss:238412kB, swap:0kB

Edit 3 This is the result of trying to run mysqld_safe

131210 21:59:17 mysqld_safe Logging to '/var/log/mysqld.log'.
131210 21:59:17 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/bin/mysqld_safe: line 166:  2677 Killed                  nohup /usr/sbin/mysqld --     basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --  log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid -- socket=/var/lib/mysql/mysql.sock < /dev/null >> /var/log/mysqld.log 2>&1
131210 21:59:18 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

Edit 4

I never found a fix for my problem; I did get a solution. One of my issues was that I never had enough memory. A VM on my local machine was using 300MB or so, which was more than my VPS had. I tried a swap file, but my VPS runs on an OpenVZ kernel and they don't support swap files.

The solution ended up being a KVM VPS. It ended up costing a few bucks more a month with double the memory, storage, and bandwidth. MySQL 5.6 on Centos 6.5 runs just fine now.

share|improve this question
    
Have you checked that the mysql user actually owns and can write into /var/lib/mysql? sc. –  swisscheese Dec 10 '13 at 14:51
    
Yep. The mysql user owns that folder. [root@sacroiliac lib]# ls -l | grep mysql drwxr-xr-x 4 mysql mysql 4096 Dec 10 17:34 mysql –  Cameron Dec 10 '13 at 14:55
    
Ok - i'd also check /var/log/messages and/or /var/log/mysqld.log (wherever your install has it located). If all all fails, you can: strace -aef /path/to/safe_mysqld –  swisscheese Dec 10 '13 at 14:59
    
Please see my next edit. –  Cameron Dec 10 '13 at 15:03
    
Reading your log (messages), it shows a memory problem: mysqld is consuming all the available memory, and the OOM process kills it before it manages the whole system to hang... –  AndrewQ Dec 10 '13 at 15:53
show 1 more comment

2 Answers

The problem/reason of this is that you do not have enough free memory to run MySQL on your VPS. It is in /var/log/messages:

Dec 10 17:34:04 sacroiliac kernel: [627203.702793] OOM killed process 1657 (mysqld) vm:385760kB, rss:238984kB, swap:0kB
Dec 10 17:34:21 sacroiliac kernel: [627220.208520] OOM killed process 1919 (mysqld) vm:385760kB, rss:238300kB, swap:0kB
Dec 10 17:50:03 sacroiliac kernel: [628160.758387] OOM killed process 2228 (mysqld) vm:385760kB, rss:238988kB, swap:0kB
Dec 10 17:51:33 sacroiliac kernel: [628250.613146] OOM killed process 2486 (mysqld) vm:385760kB, rss:237220kB, swap:0kB
Dec 10 17:51:49 sacroiliac kernel: [628266.621825] OOM killed process 2744 (mysqld) vm:385760kB, rss:238412kB, swap:0kB

OOM is an acronym for Out of Memory.

share|improve this answer
add comment

if you have /etc/init.d/mysqld start errors just go to this directory:

$ cd /var/lib/mysql/

And delete the files there:

$ rm -rf *

Then service mysqld start should work.

share|improve this answer
add comment

Your Answer

 
discard

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.