mysql.plugin 不存在_mysql - 设置MySQL时出错:表'mysql.plugin'不存在 - 堆栈内存溢出...

我在Ubuntu 16上运行没有问题的MySQL 5.7实例,但是当我尝试安装任何其他软件包或尝试通过apt-get更新现有软件包时,我收到以下错误:

# apt-get upgrade

Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...

Checking if update is needed.

Checking server version.

Running queries to upgrade MySQL server.

mysql_upgrade: [ERROR] 1146: Table 'mysql.plugin' doesn't exist

mysql_upgrade failed with exit status 5

dpkg: error processing package mysql-server-5.7 (--configure):

subprocess installed post-installation script returned error exit status 1

No apport report written because the error message indicates its a followup error from a previous failure.

dpkg: dependency problems prevent configuration of mysql-server:

mysql-server depends on mysql-server-5.7; however:

Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):

dependency problems - leaving unconfigured

Errors were encountered while processing:

mysql-server-5.7

mysql-server

如果我运行mysqlcheck ,看起来有些系统表存在,但其他系统表缺失:

mysql.columns_priv OK

mysql.db OK

mysql.engine_cost

Error : Table 'mysql.engine_cost' doesn't exist

status : Operation failed

mysql.event OK

mysql.func OK

mysql.general_log OK

mysql.gtid_executed

Error : Table 'mysql.gtid_executed' doesn't exist

status : Operation failed

mysql.help_category

Error : Table 'mysql.help_category' doesn't exist

status : Operation failed

mysql.help_keyword

Error : Table 'mysql.help_keyword' doesn't exist

status : Operation failed

mysql.help_relation

Error : Table 'mysql.help_relation' doesn't exist

status : Operation failed

mysql.help_topic

Error : Table 'mysql.help_topic' doesn't exist

status : Operation failed

mysql.innodb_index_stats

Error : Table 'mysql.innodb_index_stats' doesn't exist

status : Operation failed

mysql.innodb_table_stats

Error : Table 'mysql.innodb_table_stats' doesn't exist

status : Operation failed

mysql.ndb_binlog_index OK

mysql.plugin

Error : Table 'mysql.plugin' doesn't exist

status : Operation failed

mysql.proc OK

mysql.procs_priv OK

mysql.proxies_priv OK

mysql.server_cost

Error : Table 'mysql.server_cost' doesn't exist

status : Operation failed

mysql.servers

Error : Table 'mysql.servers' doesn't exist

status : Operation failed

mysql.slave_master_info

Error : Table 'mysql.slave_master_info' doesn't exist

status : Operation failed

mysql.slave_relay_log_info

Error : Table 'mysql.slave_relay_log_info' doesn't exist

status : Operation failed

mysql.slave_worker_info

Error : Table 'mysql.slave_worker_info' doesn't exist

status : Operation failed

mysql.slow_log OK

mysql.tables_priv OK

mysql.time_zone

Error : Table 'mysql.time_zone' doesn't exist

status : Operation failed

mysql.time_zone_leap_second

Error : Table 'mysql.time_zone_leap_second' doesn't exist

status : Operation failed

mysql.time_zone_name

Error : Table 'mysql.time_zone_name' doesn't exist

status : Operation failed

mysql.time_zone_transition

Error : Table 'mysql.time_zone_transition' doesn't exist

status : Operation failed

mysql.time_zone_transition_type

Error : Table 'mysql.time_zone_transition_type' doesn't exist

status : Operation failed

mysql.user OK

sys.sys_config

Error : Table 'sys.sys_config' doesn't exist

status : Operation failed

但是,数据库正在正常运行,如果我手动检查SQL,它看起来像表存在。

mysql> SHOW TABLES;

+---------------------------+

| Tables_in_mysql |

+---------------------------+

| columns_priv |

| db |

| engine_cost |

| event |

| func |

| general_log |

| gtid_executed |

| help_category |

| help_keyword |

| help_relation |

| help_topic |

| innodb_index_stats |

| innodb_table_stats |

| ndb_binlog_index |

| plugin |

| proc |

| procs_priv |

| proxies_priv |

| server_cost |

| servers |

| slave_master_info |

| slave_relay_log_info |

| slave_worker_info |

| slow_log |

| tables_priv |

| time_zone |

| time_zone_leap_second |

| time_zone_name |

| time_zone_transition |

| time_zone_transition_type |

| user |

+---------------------------+

我使用innodb_file_per_table=1设置,并且/var/lib/mysql目录的所有者正确设置为mysql用户。

我想在不抛弃现有数据的情况下解决这个问题,但我的想法已经不多了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值