我在 Fedora 12 上安装了 MySQL yum install mysql
。现在如何启动服务器?
[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
以下是我尝试过的所有上述命令的列表
[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
[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
也必须这样做...... yum install mysql-server
(哎呀!)
现在我收到这个错误
[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]
答案1
/etc/init.d/mysql start
或者
/usr/bin/mysql start
答案2
尝试这个命令:
services mysqld start
答案3
chkconfig --level 345 mysql on
但我不太确定它是否启动守护进程,或者只是将其设置为自动启动。