当前位置:首页 > 开发 > 数据库 > 正文

linux安装mysql提示mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

发表于: 2014-06-06   作者:107x   来源:转载   浏览:
摘要: 输入命令后报错: [root@dev1 mysql]# bin/mysqld_safe --user=mysql & [1] 15325 [root@dev1 mysql]# 091217 22:22:53 mysqld_safe Logging to '/var/lib/mysql/dev1.sccl.cn.err'. 091217 22:22:53 mysqld_safe Starti

输入命令后报错:
[root@dev1 mysql]# bin/mysqld_safe --user=mysql &
[1] 15325
[root@dev1 mysql]# 091217 22:22:53 mysqld_safe Logging to '/var/lib/mysql/dev1.sccl.cn.err'.
091217 22:22:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
091217 22:23:01 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

[root@dev1 mysql5.1]# bin/mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (1)

解决办法
vi /etc/my.cnf

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/lib/run/mysql/mysqld.pid
改成
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysqld.pid

好现象,貌似启动成功了,插件进程
[root@dev1 log]# ps -aux | grep mysql
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.3/FAQ
root     15526 0.0 0.0 5276 1112 pts/0    S    22:42   0:00 /bin/sh bin/mysqld_safe --user=mysql
mysql    15594 0.0 0.6 119232 14292 pts/0 Sl   22:42   0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/dev1.sccl.cn.err --pid-file=/var/lib/mysql/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root     15613 0.0 0.0 5976 656 pts/0    S+   22:44   0:00 grep mysql

但是登陆还是报错,修改如下:
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

登陆老是提醒我登陆的用户名和密码不对,我重新设置了一下密码
mysql -u root(默认密码为空)
登陆
登陆终于成功了:),好事多磨啊。

 

From: http://blog.csdn.net/ly_feng/article/details/7917500

linux安装mysql提示mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号