I installed mysql using yum install mysql on fedora 12. Now how do I start the mysql server?

[root@localhost init.d]# which mysql
/usr/bin/mysql

[root@localhost init.d]# mysql --version
mysql  Ver 14.14 Distrib 5.1.46, for redhat-linux-gnu (x86_64) using readline 5.1

Please, help

link|improve this question
It should already be running, shouldn't it? Can you connect using mysql -h localhost -u username -p? – Pekka May 28 '10 at 9:56
1  
You should ask this on superuser.com > /etc/init.d/mysql start (i think) – tinny May 28 '10 at 9:57
google, you'll find the answer sooner. – Sepehr Lajevardi May 28 '10 at 10:07
feedback

migrated from stackoverflow.com May 28 '10 at 10:52

This question came from our site for professional and enthusiast programmers.

4 Answers

/etc/init.d/mysql start

or

/usr/bin/mysql start
link|improve this answer
The daemon is mysqld start or mysqld_safe – nicorellius May 28 '10 at 16:56
feedback

services mysqld start

link|improve this answer
feedback

chkconfig --level 345 mysql on

But I'm not really sure, is it start the daemon, or just set it to autostart.

link|improve this answer
feedback

Ok, I'm "answering" to this question to include some formatting. Here's the list of all the above commands I tried

[root@localhost init.d]# mysql -h localhost -u username -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql
/mysql.sock' (111)
[1]+  Exit 127                /usr/bin/mysqld_safe


[root@localhost init.d]# /etc/init.d/mysql start
bash: /etc/init.d/mysql: No such file or directory


[root@localhost init.d]# /usr/bin/mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql
/mysql.sock' (111)


[root@localhost init.d]# services mysqld start
bash: services: command not found


[root@localhost init.d]# chkconfig --level 345 mysql on
error reading information on service mysql: No such file or directory

EDIT

[root@localhost init.d]# service mysql start
mysql: unrecognized service

[root@localhost init.d]# /etc/init.d/mysqld start
bash: /etc/init.d/mysqld: No such file or directory

EDIT

Had to also do this.. yum install mysql-server (Yikes!)

Now I get this error

[root@localhost vineeth]# service mysqld start
MySQL Daemon failed to start.
Starting MySQL:                                            [FAILED]

[root@localhost vineeth]# /etc/init.d/mysqld start
MySQL Daemon failed to start.
Starting MySQL:                                            [FAILED]
link|improve this answer
This magic button called "edit" is there for a reason. Just saying. – rochal May 28 '10 at 10:08
Nice, thanks. I'm new to stackoverflow, gotta get familiar soon. – Vineeth May 28 '10 at 10:10
the command to start a service on Fedora/Red Hat is 'service' not 'services'. The name of the mysql service depends on how/where you installed it from(you did install the server, not just the client , right ?), it's either mysqld or mysql. So e.g. service mysql start, or run the init script directly /etc/init.d/mysqld start – nos May 28 '10 at 10:15
also you'll need to be root to start mysql. edit: oops my bad you are already. – Richard100 May 28 '10 at 10:26
feedback

Your Answer

 
or
required, but never shown

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