1

Every time I try and add a permission I get the following error:

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

This happens using mysql in the terminal and through PhpMyAdmin

The user doing the change is root with all permissions and GRANT option. Does not matter what I set the permissions to either, all, with grant, without grant, just select. they all just have this error.

Any ideas why?

Extra info:

recently upgraded from 5.0.1 -> 5.6

I have restarted mysql

I have tried flushing privileges

# mysql --version
mysql  Ver 14.14 Distrib 5.6.19, for Linux (x86_64) using  EditLine wrapper

mysql> select current_user();
+----------------+
| current_user() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

mysql> select user();
+----------------+
| user()         |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

mysql>  SELECT host,user,password,Grant_priv,Super_priv FROM mysql.user;
+---------------------------+------------------+-------------------------------------------+------------+------------+
| host                      | user             | password                                  | Grant_priv | Super_priv |
+---------------------------+------------------+-------------------------------------------+------------+------------+
| localhost                 | root             | *hash                                     | Y          | Y          |
| localhost                 | debian-sys-maint | *hash                                     | Y          | Y          |
...trim...
+---------------------------+------------------+-------------------------------------------+------------+------------+
15 rows in set (0.00 sec)

3 Answers 3

1

Try mysql_fix_privilege_tables - upgrade MySQL system tables.

0

Turns out yum did not update the db,

2014-07-14 14:49:27 2135 [ERROR] Native table 'performance_schema'.'events_statements_history' has the wrong structure
2014-07-14 14:49:27 2135 [ERROR] Native table 'performance_schema'.'events_statements_history_long' has the wrong structure
2014-07-14 14:49:27 2135 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_thread_by_event_name' has the wrong structure
2014-07-14 14:49:27 2135 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_account_by_event_name' has the wrong structure
2014-07-14 14:49:27 2135 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_user_by_event_name' has the wrong structure
2014-07-14 14:49:27 2135 [ERROR] Native table 'performance_schema'.'events_statements_summary_by_host_by_event_name' has the wrong structure
2014-07-14 14:49:27 2135 [ERROR] Native table 'performance_schema'.'events_statements_summary_global_by_event_name' has the wrong structure

running mysql_update -u root -p<pw> sorts it out

0

I had something similar today on Gentoo. There mysql_upgrade fixed things for me.

Looking at the details of a gdb session, mysqld crashed when the function replace_user_table, called from mysql_grant, tried to access the MYSQL_USER_FIELD_PLUGIN a.k.a. plugin column of the mysql.user table, which was still absent on my system.

I consider it rather bad style that the server will crash if the system table schema is outdated, but apparently that's the way it is written.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .