mysql#U升级失败-innodb表不';不存在?
我正在将我的mysql-5.5 docker容器数据库升级到mysql-5.6 docker容器。我能够解决所有其他问题。最后,我的服务器运行的是5.6。但是当我运行mysql\u升级时,我得到了以下错误 错误:mysql#U升级失败-innodb表不';不存在?,mysql,docker,innodb,mysqlupgrade,Mysql,Docker,Innodb,Mysqlupgrade,我正在将我的mysql-5.5 docker容器数据库升级到mysql-5.6 docker容器。我能够解决所有其他问题。最后,我的服务器运行的是5.6。但是当我运行mysql\u升级时,我得到了以下错误 错误: root@17aa74cbc5e2# mysql_upgrade -uroot -password Warning: Using a password on the command line interface can be insecure. Looking f
root@17aa74cbc5e2# mysql_upgrade -uroot -password
Warning: Using a password on the command line interface can be insecure.
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock'
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock'
Warning: Using a password on the command line interface can be insecure.
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
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 OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
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 OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Repairing tables
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.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
Running 'mysql_fix_privilege_tables'...
Warning: Using a password on the command line interface can be insecure.
ERROR 1146 (42S02) at line 62: Table 'mysql.innodb_table_stats' doesn't exist
ERROR 1243 (HY000) at line 63: Unknown prepared statement handler (stmt) given to EXECUTE
ERROR 1243 (HY000) at line 64: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE
ERROR 1146 (42S02) at line 66: Table 'mysql.innodb_index_stats' doesn't exist
ERROR 1243 (HY000) at line 67: Unknown prepared statement handler (stmt) given to EXECUTE
ERROR 1243 (HY000) at line 68: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE
ERROR 1146 (42S02) at line 81: Table 'mysql.slave_relay_log_info' doesn't exist
ERROR 1243 (HY000) at line 82: Unknown prepared statement handler (stmt) given to EXECUTE
ERROR 1243 (HY000) at line 83: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE
ERROR 1146 (42S02) at line 110: Table 'mysql.slave_master_info' doesn't exist
ERROR 1243 (HY000) at line 111: Unknown prepared statement handler (stmt) given to EXECUTE
ERROR 1243 (HY000) at line 112: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE
ERROR 1146 (42S02) at line 128: Table 'mysql.slave_worker_info' doesn't exist
ERROR 1243 (HY000) at line 129: Unknown prepared statement handler (stmt) given to EXECUTE
ERROR 1243 (HY000) at line 130: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE
ERROR 1146 (42S02) at line 1896: Table 'mysql.slave_master_info' doesn't exist
ERROR 1146 (42S02) at line 1897: Table 'mysql.slave_master_info' doesn't exist
ERROR 1146 (42S02) at line 1898: Table 'mysql.slave_master_info' doesn't exist
ERROR 1146 (42S02) at line 1899: Table 'mysql.slave_worker_info' doesn't exist
ERROR 1146 (42S02) at line 1900: Table 'mysql.slave_relay_log_info' doesn't exist
ERROR 1146 (42S02) at line 1904: Table 'mysql.innodb_table_stats' doesn't exist
ERROR 1146 (42S02) at line 1908: Table 'mysql.innodb_index_stats' doesn't exist
FATAL ERROR: Upgrade failed
这是MySQL 5.6中的一个已知错误 根据对bug报告的回复,您可以手动创建缺少的表。缺失表格的结构如附件所示 应采取的步骤:
*.frm
和*.ibd
文件
创建表'innodb\u index\u stats`(
`数据库名称'varchar(64)COLLATE utf8\u bin非空,
`表\u name`varchar(64)COLLATE utf8\u bin NOT NULL,
`索引\u name`varchar(64)COLLATE utf8\u bin非空,
`last_update`时间戳非空默认当前时间戳更新当前时间戳,
`stat_name`varchar(64)COLLATE utf8_bin非空,
`stat_value`bigint(20)无符号非空,
`sample_size`bigint(20)无符号默认为空,
`stat_description`varchar(1024)COLLATE utf8_bin非空,
主键(`database\u name`、`table\u name`、`index\u name`、`stat\u name`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8\u bin STATS\u PERSISTENT=0;
创建表“innodb\u TABLE\u stats”(
`数据库名称'varchar(64)COLLATE utf8\u bin非空,
`表\u name`varchar(64)COLLATE utf8\u bin NOT NULL,
`last_update`时间戳非空默认当前时间戳更新当前时间戳,
`n_rows`bigint(20)无符号非空,
`聚集索引大小`bigint(20)无符号非空,
`其他索引大小之和'bigint(20)无符号非空,
主键(`database\u name`、`table\u name`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8\u bin STATS\u PERSISTENT=0;
创建表'slave\u master\u info`(
`行数'int(10)unsigned NOT NULL COMMENT'文件中的行数',
`Master_log_name`文本字符集utf8 COLLATE utf8_bin NOT NULL COMMENT'当前从Master读取的Master二进制日志的名称',
`Master_log_pos`bigint(20)unsigned NOT NULL COMMENT`上次读取事件的主日志位置',
`主机`字符(64)字符集utf8 COLLATE utf8\u bin NOT NULL默认值''注释'主机的主机名',
`User\u name`文本字符集utf8 COLLATE utf8\u bin COMMENT'用于连接到主机的用户名',
`用户\u密码`文本字符集utf8校对utf8\u bin注释'用于连接到主机的密码',
`端口'int(10)unsigned NOT NULL COMMENT'用于连接到主机的网络端口。',
`Connect_retry`int(10)unsigned NOT NULL COMMENT`从机在尝试重新连接到主机之前将等待的时间段(以秒为单位)。”,
`Enabled_ssl“tinyint(1)NOT NULL COMMENT”表示服务器是否支持ssl连接。“,
`Ssl_ca `文本字符集utf8校对utf8_bin注释'用于证书颁发机构(ca)证书的文件',
`Ssl_capath `文本字符集utf8校对utf8_bin注释'证书颁发机构(CA)证书的路径',
`Ssl\u cert`文本字符集utf8校对utf8\u bin注释'Ssl证书文件的名称',
`Ssl_cipher`text CHARACTER SET utf8 COLLATE utf8\u bin COMMENT`用于Ssl连接的密码的名称',
`Ssl_key`文本字符集utf8整理utf8_bin注释'Ssl密钥文件的名称',
`Ssl\u verify\u server\u cert`tinyint(1)NOT NULL COMMENT`是否验证服务器证书',
`Heartbeat'float NOT NULL,
`Bind`text CHARACTER SET utf8 COLLATE utf8\u bin COMMENT`显示连接到MySQL服务器时使用的接口',
`忽略的\u服务器\u ID`文本字符集utf8整理utf8\u bin注释'要忽略的服务器ID数,后跟实际的服务器ID',
`Uuid`文本字符集utf8校对utf8\u bin注释'主服务器Uuid',
`在放弃之前,重试计数'bigint(20)unsigned NOT NULL COMMENT'到主机的重新连接尝试次数,
`Ssl_crl`文本字符集utf8 COLLATE utf8_bin COMMENT'用于证书吊销列表(crl)的文件',
`Ssl_crlpath`文本字符集utf8校对utf8_bin注释'用于证书吊销列表(CRL)文件的路径',
`已启用的自动位置“tinyint(1)NOT NULL COMMENT”表示是否将使用GTID从主机检索事件,
主键(`Host`、`Port`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Master Information';
创建表“从属继电器日志信息”(
`行数`int(10)unsigned NOT NULL COMMENT`文件中的行数或表中的行数。用于版本表定义。“,
`中继日志名称`text CHARACTER SET utf8 COLLATE utf8\u bin NOT NULL COMMENT`当前中继日志文件的名称',
`中继日志位置'bigint(20)unsigned NOT NULL COMMENT'上次执行事件的中继日志位置',
`Master_log_name`文本字符集utf8 COLLATE utf8_bin NOT NULL COMMENT'从中读取中继日志文件中事件的主二进制日志文件的名称',
`Master_log_pos`bigint(20)unsigned NOT NULL COMMENT`上次执行的事件的主日志位置',
`Sql_delay`int(11)NOT NULL COMMENT`从属服务器必须落后于主服务器的秒数,
`未签名的整型(10)工人数量不为空,
`Id`int(10)unsigned NOT NULL COMMENT`唯一标识此记录的内部Id。“,
主键(`Id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Relay Log Information';
创建表'slave\u worker\u info`(
`Id`int(10)无符号非空,
`中继日志名称`文本字符集utf8 COLLATE utf8\U bin NOT NULL,
`继电器日志位置“bigint(20)无符号非空,
`主日志
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
- | host |
+ | innodb_index_stats |
+ | innodb_table_stats |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| 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 |
+---------------------------+
--
-- Table structure for table `gtid_slave_pos`
--
DROP TABLE IF EXISTS `gtid_slave_pos`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gtid_slave_pos` (
`domain_id` int(10) unsigned NOT NULL,
`sub_id` bigint(20) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`seq_no` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`domain_id`,`sub_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Replication slave GTID position';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gtid_slave_pos`
--
LOCK TABLES `gtid_slave_pos` WRITE;
/*!40000 ALTER TABLE `gtid_slave_pos` DISABLE KEYS */;
/*!40000 ALTER TABLE `gtid_slave_pos` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `innodb_index_stats`
--
DROP TABLE IF EXISTS `innodb_index_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `innodb_index_stats` (
`database_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`index_name` varchar(64) COLLATE utf8_bin NOT NULL,
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`stat_name` varchar(64) COLLATE utf8_bin NOT NULL,
`stat_value` bigint(20) unsigned NOT NULL,
`sample_size` bigint(20) unsigned DEFAULT NULL,
`stat_description` varchar(1024) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `innodb_index_stats`
--
LOCK TABLES `innodb_index_stats` WRITE;
/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */;
/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `innodb_table_stats`
--
DROP TABLE IF EXISTS `innodb_table_stats`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `innodb_table_stats` (
`database_name` varchar(64) COLLATE utf8_bin NOT NULL,
`table_name` varchar(64) COLLATE utf8_bin NOT NULL,
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`n_rows` bigint(20) unsigned NOT NULL,
`clustered_index_size` bigint(20) unsigned NOT NULL,
`sum_of_other_index_sizes` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`database_name`,`table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `innodb_table_stats`
--
LOCK TABLES `innodb_table_stats` WRITE;
/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */;
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `slave_master_info`
--
DROP TABLE IF EXISTS `slave_master_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `slave_master_info` (
`Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file.',
`Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log currently being read from the master.',
`Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last read event.',
`Host` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'The host name of the master.',
`User_name` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The user name used to connect to the master.',
`User_password` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The password used to connect to the master.',
`Port` int(10) unsigned NOT NULL COMMENT 'The network port used to connect to the master.',
`Connect_retry` int(10) unsigned NOT NULL COMMENT 'The period (in seconds) that the slave will wait before trying to reconnect to the master.',
`Enabled_ssl` tinyint(1) NOT NULL COMMENT 'Indicates whether the server supports SSL connections.',
`Ssl_ca` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Authority (CA) certificate.',
`Ssl_capath` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path to the Certificate Authority (CA) certificates.',
`Ssl_cert` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL certificate file.',
`Ssl_cipher` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the cipher in use for the SSL connection.',
`Ssl_key` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL key file.',
`Ssl_verify_server_cert` tinyint(1) NOT NULL COMMENT 'Whether to verify the server certificate.',
`Heartbeat` float NOT NULL,
`Bind` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'Displays which interface is employed when connecting to the MySQL server',
`Ignored_server_ids` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The number of server IDs to be ignored, followed by the actual server IDs',
`Uuid` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The master server uuid.',
`Retry_count` bigint(20) unsigned NOT NULL COMMENT 'Number of reconnect attempts, to the master, before giving up.',
`Ssl_crl` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Revocation List (CRL)',
`Ssl_crlpath` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path used for Certificate Revocation List (CRL) files',
`Enabled_auto_position` tinyint(1) NOT NULL COMMENT 'Indicates whether GTIDs will be used to retrieve events from the master.',
PRIMARY KEY (`Host`,`Port`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Master Information';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `slave_master_info`
--
LOCK TABLES `slave_master_info` WRITE;
/*!40000 ALTER TABLE `slave_master_info` DISABLE KEYS */;
/*!40000 ALTER TABLE `slave_master_info` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `slave_relay_log_info`
--
DROP TABLE IF EXISTS `slave_relay_log_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `slave_relay_log_info` (
`Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.',
`Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.',
`Relay_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The relay log position of the last executed event.',
`Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log file from which the events in the relay log file were read.',
`Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last executed event.',
`Sql_delay` int(11) NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.',
`Number_of_workers` int(10) unsigned NOT NULL,
`Id` int(10) unsigned NOT NULL COMMENT 'Internal Id that uniquely identifies this record.',
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Relay Log Information';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `slave_relay_log_info`
--
LOCK TABLES `slave_relay_log_info` WRITE;
/*!40000 ALTER TABLE `slave_relay_log_info` DISABLE KEYS */;
/*!40000 ALTER TABLE `slave_relay_log_info` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `slave_worker_info`
--
DROP TABLE IF EXISTS `slave_worker_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `slave_worker_info` (
`Id` int(10) unsigned NOT NULL,
`Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`Relay_log_pos` bigint(20) unsigned NOT NULL,
`Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`Master_log_pos` bigint(20) unsigned NOT NULL,
`Checkpoint_relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`Checkpoint_relay_log_pos` bigint(20) unsigned NOT NULL,
`Checkpoint_master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`Checkpoint_master_log_pos` bigint(20) unsigned NOT NULL,
`Checkpoint_seqno` int(10) unsigned NOT NULL,
`Checkpoint_group_size` int(10) unsigned NOT NULL,
`Checkpoint_group_bitmap` blob NOT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Worker Information';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `slave_worker_info`
--
LOCK TABLES `slave_worker_info` WRITE;
/*!40000 ALTER TABLE `slave_worker_info` DISABLE KEYS */;
/*!40000 ALTER TABLE `slave_worker_info` ENABLE KEYS */;
UNLOCK TABLES;
ERROR 1813 (HY000): Tablespace '`mysql`.`slave_worker_info`' exists.
cd /opt/zimbra/db/data/mysql/
mv innodb_*frm gtid_slave_pos.*frm ~
mv innodb_* gtid_slave_pos.* ~
~/common/bin/mysql_upgrade -S/opt/zimbra/data/tmp/mysql/mysql.sock -u root --password=$mysql_root_password --force