mysql错误:STOPPING server from pid file /usr/local/mysql/data/hello.pid解决方法

来自网络:

执行/usr/bin/mysqld_safe &后
出现:Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /tmp/mysqld.pid
061026 20:32:33  mysqld ended

1.data文件夹的mysql权限没有给出!
执行命令:
chown -R mysql /usr/local/mysql/data

{安装时别忘记指出安装目录和data目录
--prefix=/usr/local/mysql     --localstatedir=/usr/local/mysql/data
localstatedir是存放数据的场所}
2.my.cnf的配置文件出现错误。(配置出错会导致如上错误)
3. 用root启动Mysql
/usr/local/mysql/bin/mysqld_safe --user=root &

 

自己解决的方法:

 cp support-files/my-small.cnf /etc/my.cnf
/usr/local/mysql/bin/mysqld_safe &
报如下错误:
[root@hello mysql-5.0.56]# /usr/local/mysql/bin/mysqld_safe &
[1] 4313
[root@hello mysql-5.0.56]# Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/hello.pid
111012 22:45:57  mysqld ended


[1]+  Done                    /usr/local/mysql/bin/mysqld_safe
然后我重新复制了一个配置文件:
/bin/cp support-files/my-medium.cnf /etc/my.cnf

 [root@hello mysql-5.0.56]# /usr/local/mysql/bin/mysqld_safe &
[1] 4960
[root@hello mysql-5.0.56]# Starting mysqld daemon with databases from /usr/local/mysql/data

[root@hello mysql-5.0.56]# netstat -lntp |grep 3306
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      4983/mysqld 



my-small.cnf和my-medium.cnf会导致mysql服务不能启动?