MySQL报错:ERROR 2013 (HY000): Lost connection to MySQL server during query

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL报错:ERROR 2013 (HY000): Lost connection to MySQL server during query相关的知识,希望对你有一定的参考价值。

    首先贴上实验用各版本:

OS:CentOS 6.5

mysql

mysql> select version ();
+------------+
| version () |
+------------+
| 5.6.22     |
+------------+
1 row in set (0.00 sec)

事情是这样的:本来是要在虚机上搭建一个wordpress做实验,刚创建完数据库,就在赋权额时候发生不在计划的错误:

mysql>grant all on wordpress.* to [email protected] identified by "wp123456";

ERROR 2013 (HY000): Lost connection to MySQL server during query

查看报错日志如下:tail -fn 30 /var/log/mysqld.log

2016-11-15 12:56:22 112085 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it

2016-11-15 12:56:22 112085 [ERROR] Native table ‘performance_schema‘.‘cond_instances‘ has the wrong structure

2016-11-15 12:56:22 112085 [ERROR] Native table ‘performance_schema‘.‘events_waits_current‘ has the wrong structure

2016-11-15 12:56:22 112085 [ERROR] Native table ‘performance_schema‘.‘events_waits_history‘ has the wrong structure

2016-11-15 12:56:22 112085 [ERROR] Native table ‘performance_schema‘.‘events_waits_history_long‘ has the wrong structure

    看报错日志一直在提示wrong structure(结构错误),通常结构错误是由升级MySQL版本导致的,我虽然没有升级,但是在安装MySQL5.6.22前,安装的是5.1版本,可能是由于卸除的不干净(但是之前在赋权时并没有此问题,疑惑??),看了网上N多方法,但是对于我的问题就是不感冒啊!突然在网上看到一个升级脚本修复的例子,就想着我的是不是也适用(因为我之前装过旧版本),所以就试了一下果然OK啊!看到成功那一刻,一扫额头阴霾O(∩_∩)O~

    执行升级脚本命令:

/usr/local/mysql/bin/mysql_upgrade -u root -p

输入密码后回车,再次赋权成功啦,哇咔咔..........

技术分享

mysql> grant all on wordpress.* to [email protected] identified by "wp123456";
Query OK, 0 rows affected (0.00 sec)

本文出自 “龙卷风” 博客,请务必保留此出处http://ruilong.blog.51cto.com/4043170/1873096

以上是关于MySQL报错:ERROR 2013 (HY000): Lost connection to MySQL server during query的主要内容,如果未能解决你的问题,请参考以下文章

MySQL报错ERROR1872(HY000):Slave failed to initialize

MySQL关于ERROR 1290 (HY000)报错

解决MySQL报错ERROR 2002 (HY000)

解决MySQL报错ERROR 2002 (HY000)

mysql 报错ERROR 1820 (HY000):You must resetpassword

mysql在导入大数据库的时候,报错ERROR 2006 (HY000): MySQL server has gone away