为什么我无法添加/更改 mysql 的权限

为什么我无法添加/更改 mysql 的权限

每次我尝试添加权限时都会出现以下错误:

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

这是mysql在终端中使用并通过PhpMyAdmin

执行更改的用户是具有所有权限和 GRANT 选项的 root 用户。无论我将权限设置为全部、带授权、不带授权还是仅选择,都没有关系。它们都出现此错误。

知道原因吗?

额外信息:

最近从 5.0.1 升级到 5.6

我已经重新启动了 mysql

我尝试过刷新权限

# 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)

答案1

尝试mysql_fix_privilege_tables——升级 MySQL 系统表。

答案2

事实证明 yum 并未更新数据库,

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

跑步mysql_update -u root -p<pw>可以解决问题

答案3

我今天在 Gentoo 上也遇到了类似的问题。他们mysql_upgrade帮我解决了问题。

查看 gdb 会话的详细信息,当调用的mysqld函数试图访问表的aka列时崩溃,但该列在我的系统上仍然不存在。replace_user_tablemysql_grantMYSQL_USER_FIELD_PLUGINpluginmysql.user

如果系统表模式过时,服务器就会崩溃,我认为这是相当糟糕的风格,但显然这就是它的写法。

相关内容