Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

So I have this VPS on CentOS. A few months ago, I installed apache2, mysql and some other stuff, to host a wordpress blog. Now, for some reason, the mysql service has shutdown, and I'm unable to restart it.

  • "which mysql" returns "/usr/bin/mysql" seems to confirm it is indeed installed
  • "/etc/init.d/mysql" returns "-bash: /etc/init.d/mysql: No such file or directory"
  • "service mysql start" returns "-bash: service: command not found"
  • Interchanging mysql for mysqld did not made any changes in those last two points
  • Only log file related to mysql, in the /var/log folder is named mysqld.log.rpmsave and is empty

Thruthfully, I'm a programmer and I am utterly confused by this situation. Any idea?

-- EDIT --

Thanks for your answers guys. I tried Caleb and lain's suggestion and unfortunately /sbin/service mysql start or /sbin/service mysqld start returns me unrecognized service.

As for the result of rpm -qa | grep mysql : php-mysql-5.3.3-1.el5.remi mysql-libs-5.1.53-1.el5.remi mysql-5.1.53-1.el5.remi

remi being the repo where I found newer version of PHP (from 5.1.X to 5.3).

share|improve this question

5 Answers 5

up vote 2 down vote accepted

From the remi repo, you need mysql-server. Try yum install mysql-server; you'll then be able to chkconfig and service mysqld to your heart's content.

If your remi repo isn't enabled by default, it'll be yum --enablerepo=remi install mysql-server; try that if you get a bunch of unresolved dependency messages.

share|improve this answer
    
Yep. These other answers ignore the fact that you don't have the server installed. –  dmourati Apr 15 '11 at 2:56
    
To be fair, he edited the question to add the rpm -qa output. –  BMDan Apr 15 '11 at 13:41
    
Yeah that was pretty much the problem. For some freak reason, a repository conflict or something along those line, mysqld was uninstalled. Re-installed it and it's all good now. –  Afrosimon Apr 18 '11 at 4:39
    
Wow. I am a moron. Lucky I found your answer –  saccharine Feb 5 '13 at 23:46

My guess is that you somehow removed the server part of MySQL. /usr/bin/mysql is just the client part and doesn't have an entry in /etc/init.d. Can you post the output of rpm -qa | grep mysql?

share|improve this answer

On CentOS to start the mysql-server (mysqld) use the command

/sbin/service mysqld start
share|improve this answer

Try /sbin/service mysql restart.

Looks like your shell, including exec paths and such, is pretty messed up, but you have been on the right track.

share|improve this answer
    
Yeah that is probably related to the installation and setup step I did a few months ago, quite rashly. –  Afrosimon Apr 18 '11 at 4:40

You don't have the server installed.

# yum -y install mysql-server
# service mysqld start
share|improve this answer

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.