ubuntu下连接mysql时报错:Lost connection to MySQL server at 'reading initial communication packet', system
2014-06-24 14:09
696 查看
使用终端运行mysql,报出如下错误:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
百度之,发现是由于mysqld.sock文件被误删之后导致的。
解决方法如下:
以root用户重建授权表
#usr/local/bin/mysql_install_db //以root重建授权表
或者是以mysql的身份:
#su mysql
$/usr/local/bin/mysql_install_db //重建授权表
然后就会出现如下的信息:
$/usr/local/bin/mysqld_safe & //mysqld_safe & 启动mysql的守护进程
$/usr/local/bin/mysql //测试
mysq>bye;
至此, ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 的问题解决.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
百度之,发现是由于mysqld.sock文件被误删之后导致的。
解决方法如下:
以root用户重建授权表
#usr/local/bin/mysql_install_db //以root重建授权表
或者是以mysql的身份:
#su mysql
$/usr/local/bin/mysql_install_db //重建授权表
然后就会出现如下的信息:
$/usr/local/bin/mysqld_safe & //mysqld_safe & 启动mysql的守护进程
$/usr/local/bin/mysql //测试
mysq>bye;
至此, ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 的问题解决.
相关文章推荐
- Lost connection to MySQL server at ‘reading initial communication packet', system error: 0 mysql远程连接
- Lost connection to MySQL server at 'reading initial communication packet et system error:0
- 连接mysql出现Lost connection to MySQL server at 'reading initial communication packet', system error: 0
- MySQL远程连接丢失问题解决方法Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- lost connection to mysql server at 'reading initial communication packet',system error:2
- Lost connection to MySQL server at ‘reading initial communication packet
- mysql Lost connection to MySQL server at ‘reading initial communication packet
- Mysql连接错误:Lost connection to Mysql server at 'waiting for initial communication packet'
- MySql Lost connection to MySQL server at 'reading initial communication packet', system error: 0
- Lost connection to MySQL server at ‘reading initial communication packet
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 111
- 解决lost connection to mysql server at reading initial communication packet
- 有关Mysql出现Lost connection to MySQL server at 'reading initial communication packet', system error: 0的一个解决方案
- [Err] [Dtf] 2013 - Lost connection to MySQL server at 'reading initial communication packet', 复制数据问题
- Lost connection to MySQL server at 'reading initial communication packet' 错误解决
- Lost connection to MySQL server at 'reading initial communication packet' 错误解决
- Lost connection to MySQL server at ‘reading initial communication packet', system error: 0
- Lost connection to MySQL server at 'reading initial communication packet', system error: 111 (MySQL
- MySQL error: 2013, “Lost connection to MySQL server at 'reading initial communication packet', syste