ERROR 1146 (42S02): Table ‘mysql.servers’ doesn’t exist

修改用户权限,刷新权限表,报1146

mysql> flush privileges;

ERROR 1146 (42S02): Table 'mysql.servers' doesn't exist

mysql> use mysql;

mysql> show tables;可以看到servers表,在系统mysql 目录下,可以看到server.ibd 和server.frm,可知表定义为innodb表。

mysql> drop table if exists servers;
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> show warnings;
+---------+------+-------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------+
| Warning | 1146 | Table 'mysql.servers' doesn't exist |
+---------+------+-------------------------------------+
1 row in set (0.00 sec)

mysql>CREATE TABLE servers (
Server_name char(64) NOT NULL DEFAULT '',
Host char(64) NOT NULL DEFAULT '',
Db char(64) NOT NULL DEFAULT '',
Username char(64) NOT NULL DEFAULT '',
Password char(64) NOT NULL DEFAULT '',
Port int(4) NOT NULL DEFAULT '0',
Socket char(64) NOT NULL DEFAULT '',
Wrapper char(64) NOT NULL DEFAULT '',
Owner char(64) NOT NULL DEFAULT '',
PRIMARY KEY (Server_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='MySQL Foreign Servers table'

ERROR 1146 (42S02): Table 'mysql.servers' doesn't exist

mysql> CREATE TABLE servers (

-> Server_name char(64) NOT NULL,
-> Host char(64) NOT NULL,
-> Db char(64) NOT NULL,
-> Username char(64) NOT NULL,
-> Password char(64) NOT NULL,
-> Port int(4) DEFAULT NULL,
-> Socket char(64) DEFAULT NULL,
-> Wrapper char(64) NOT NULL,
-> Owner char(64) NOT NULL,
-> PRIMARY KEY (Server_name)
-> ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Query OK, 0 rows affected(0.01 sec)

可以创建,数据库打开这张表的默认引擎为MyISAM,但是这张表在建表时的引擎为INNODB;

将来不迎,当下不杂,过往不念。

Original: https://www.cnblogs.com/ghjbk/p/13495761.html
Author: ノGHJ
Title: ERROR 1146 (42S02): Table ‘mysql.servers’ doesn’t exist

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/8258/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

免费咨询
免费咨询
扫码关注
扫码关注
联系站长

站长Johngo!

大数据和算法重度研究者!

持续产出大数据、算法、LeetCode干货,以及业界好资源!

2022012703491714

微信来撩,免费咨询:xiaozhu_tec

分享本页
返回顶部