MySQL ERROR 2002

下午运行mysql命令,报错:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

mysql服务器没有启动。

查看系统日志文件 /var/log/syslog:
Sep  2 16:42:20 learne-desktop mysqld_safe[7334]: started
667 Sep  2 16:42:20 learne-desktop mysqld[7337]: 090902 16:42:20  InnoDB: Started; log sequence number 0 73284
668 Sep  2 16:42:20 learne-desktop mysqld[7337]: 090902 16:42:20 [ERROR] Fatal error: Can't open and lock privilege tables: T    able 'mysql.host' doesn't exist
669 Sep  2 16:42:20 learne-desktop mysqld_safe[7349]: ended
670 Sep  2 16:42:34 learne-desktop /etc/init.d/mysql[7499]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/m    ysql/debian.cnf ping' resulted in
671 Sep  2 16:42:34 learne-desktop /etc/init.d/mysql[7499]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
672 Sep  2 16:42:34 learne-desktop /etc/init.d/mysql[7499]: error: 'Can't connect to local MySQL server through socket '/var/    run/mysqld/mysqld.sock' (2)'
673 Sep  2 16:42:34 learne-desktop /etc/init.d/mysql[7499]: Check that mysqld is running and that the socket: '/var/run/mysql    d/mysqld.sock' exists!

大概就是一些系统启动时必须的表被破坏了吧!

解决方法:
1. cd /usr/bin/
2. sudo ./mysql_install_db

 

纠结了一下午!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值