mysql 1813_ERROR 1813 (HY000) at line 404: Tablespace for table '`xxx`.`xxxxx`' exists.
今天在进行mysql备份实验时,通过mysqldump命令将主机host1中的所有数据库备份到主机Host2中,
在执行命令时出现了如下错误信息。[root@localhost tmp]# mysqldump -h 192.168.5.22 -u root --password=1234 --all-databases|
mysql -h 192.168.5.33 -uroot --password=1234
ERROR 1813 (HY000) at line 404: Tablespace for table '`mysql`.`innodb_index_stats`' exists.
Please DISCARD the tablespace before IMPORT.
mysqldump: Got errno 32 on write
这个错误是说数据库mysql.innodb_index_stats 的表空间已经存在,在导入数据之前需要将这个表空间释放到。根据提示,进入到主机Host2中数据库存放目录中手工删除这些文件,操作如下:[root@localhost ~]# cd /var/lib/mysql/mysql
[root@localhost mysql]# ls
columns_priv.frm help_relation.frm procs_priv.frm time_zone.frm
columns_priv.MYD help_relation.MYD procs_priv.MYD time_zone_leap_second.frm
columns_priv.MYI help_relation.MYI procs_priv.MYI time_zone_leap_second.MYD
db.frm help_topic.frm proxies_priv.frm time_zone_leap_second.MYI
db.MYD help_topic.MYD proxies_priv.MYD time_zone.MYD
db.MYI help_topic.MYI proxies_priv.MYI time_zone.MYI
event.frm host.frm servers.frm time_zone_name.frm
event.MYD host.MYD servers.MYD time_zone_name.MYD
event.MYI host.MYI servers.MYI time_zone_name.MYI
func.frm innodb_index_stats.ibd slave_master_info.frm time_zone_transition.frm
func.MYD innodb_table_stats.frm slave_master_info.ibd time_zone_transition.MYD
func.MYI innodb_table_stats.ibd slave_relay_log_info.frm time_zone_transition.MYI
general_log.CSM ndb_binlog_index.frm slave_relay_log_info.ibd time_zone_transition_type.frm
general_log.CSV ndb_binlog_index.MYD slave_worker_info.frm time_zone_transition_type.MYD
general_log.frm ndb_binlog_index.MYI slave_worker_info.ibd time_zone_transition_type.MYI
help_category.frm plugin.frm slow_log.CSM user.frm
help_category.MYD plugin.MYD slow_log.CSV user.MYD
help_category.MYI plugin.MYI slow_log.frm user.MYI
help_keyword.frm proc.frm tables_priv.frm
help_keyword.MYD proc.MYD tables_priv.MYD
help_keyword.MYI proc.MYI tables_priv.MYI
[root@localhost mysql]# mv innodb_index_stats.ibd /tmp #这里将文件剪切到/tmp目录中去
[root@localhost mysql]# service mysql restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]
重启完成后,进入主机Host1中再次执行备份命令,这时又出现了以下错误:[root@localhost tmp]# mysqldump -h 192.168.5.22 -u root --password=1234 --all-databases|mysql -h 192.168.5.33 -uroot --password=1234
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
ERROR 1813 (HY000) at line 434: Tablespace for table '`mysql`.`innodb_table_stats`' exists. Please DISCARD the tablespace before IMPORT.
于是再次进入Host2中,删除innodb_table_stats文件,删除之后再次重启mysql服务器[root@localhost mysql]# mv innodb_table_stats.ibd /tmp
[root@localhost mysql]# service mysql restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]
之后,再次进入Host1中执行备份命令,又会出现新的表错误信息,在Host2中执行同样的操作,依次删除文件slave_master_info、slave_relay_log_info、slave_worker_info后,直至不在出现错误信息,主机host1中的数据库全部复制到主机Host2中。## 主机Host1执行的操作
[root@localhost tmp]# mysqldump -h 192.168.5.22 -u root --password=1234 --all-databases|mysql -h 192.168.5.33 -uroot --password=1234
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
ERROR 1813 (HY000) at line 647: Tablespace for table '`mysql`.`slave_master_info`' exists. Please DISCARD the tablespace before IMPORT.
[root@localhost tmp]# mysqldump -h 192.168.5.22 -u root --password=1234 --all-databases|mysql -h 192.168.5.33 -uroot --password=1234
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
ERROR 1813 (HY000) at line 691: Tablespace for table '`mysql`.`slave_relay_log_info`' exists. Please DISCARD the tablespace before IMPORT.
[root@localhost tmp]# mysqldump -h 192.168.5.22 -u root --password=1234 --all-databases|mysql -h 192.168.5.33 -uroot --password=1234
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
ERROR 1813 (HY000) at line 720: Tablespace for table '`mysql`.`slave_worker_info`' exists. Please DISCARD the tablespace before IMPORT.
[root@localhost tmp]# mysqldump -h 192.168.5.22 -u root --password=1234 --all-databases|mysql -h 192.168.5.33 -uroot --password=1234
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
[root@localhost tmp]#
## 主机Host2中执行的操作
[root@localhost mysql]# mv innodb_table_stats.ibd /tmp
[root@localhost mysql]# service mysql restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]
[root@localhost mysql]# mv slave_master_info.ibd /tmp
[root@localhost mysql]# service mysql restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]
[root@localhost mysql]# mv slave_relay_log_info.ibd /tmp
[root@localhost mysql]# service mysql restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]
[root@localhost mysql]# mv slave_worker_info.ibd /tmp
[root@localhost mysql]# service mysql restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]
解决流程如下:1、关闭所有mysql操作,停止mysql服务。
2、找到安装目录下的数据库文件,应该在你安装目录下的data文件夹下,然后打开你对应的数据库名的文件夹。找到那个表对应的文件,将其删除。数据库中的文件名,应该是和你的表名一一对应的,一个表,两个文件,一个数据文件,一个是日志文件,除了这个还有一个“db.opt”文件不要删除。其他的乱码的文件,和原来你出错的文件全部删除。
3、完了以后重新启动mysql服务,重新添加那个同样名字的表就可以添加成功了。
mysql 1813_ERROR 1813 (HY000) at line 404: Tablespace for table '`xxx`.`xxxxx`' exists.相关推荐
- mysql错误代码1813_ERROR 1813 (HY000) at line 404: Tablespace for table '`xxx`.`xxxxx`' exists.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36## ...
- ERROR 1813 -Mysql:Tablespace for table 'xxx`.'xxx` exists.
ERROR 1813 (HY000) at line 73: Tablespace for table '`test`.`student`' exists. Please DISCARD the ta ...
- MySQL 语法问题:You can‘t specify target table ‘xxx‘ for update in FROM clause. 原因及解决方法
报错信息如下: [Code: 1093, SQL State: HY000] You can't specify target table 'bd_bankaccbas' for update in ...
- mysql创建表时报Error : Tablespace for table '`database`.`temp`' exists.
mysql有一个数据库无法删除,运行脚本也报错,刚开始没当回事.直到这次测试用的数据库需要新增表,运行脚本直接写SQL创建都出错,才来弄这个问题. **此方法适用场景:**1.无法删库. 2.新建表报 ...
- Tablespace for table ‘`xxx`.`xxx`‘ exists. Please DISCARD the tablespace
解决办法 进入 mysql cd /var/lib/mysql/{库名} ls {表名}* rm -rf {过滤的文件}
- mysql问题#1146 - Table 'xxx.xxxxx' doesn't exist
这次出现这个问题是由于博主手yang,误删mysql重要文件所致的. 在重装mysql后,进入mysql navicat发现之前的数据库中的表都无法使用了,尴尬探索之际发现,这个是由于重新安装mysq ...
- MySQL_解决ERROR 2006 (HY000) at line XX MySQL server has gone away问题
MySQL_解决ERROR 2006 (HY000) at line XX MySQL server has gone away问题 参考文章: (1)MySQL_解决ERROR 2006 (HY00 ...
- mysql报1840_mysql 帮助手册 以及 warning: World-writable config file 以及 ERROR 1840 (HY000) at line 24:...
问题分析 在关闭数据库的命令发现mysql关不了,提示Warning: World-writable config file '/etc/my.cnf' is ignored,大概意思是权限全局可写, ...
- blast2go centos mysql 5.7++ 安装报错ERROR 1819 (HY000) at line 4
1)解决导入数据mysql -uroot -p passwd <b2gdb.sql 报错ERROR 1819 (HY000) at line 4: Your password does not ...
最新文章
- etcd与mysql_一、配置etcd数据库
- 4 拼接_解析,地漏与瓷砖的4种拼接方法及安装工艺
- 程序员面试题精选100题(51)-顺时针打印矩阵[算法]
- 2.4-2.5、Hive整合(整合Spark、整合Hbase)、连接方式Cli、HiveServer和hivemetastore、Squirrel SQL Client等
- 恒生估值系统_恒生指数和恒生国企指数投资价值分析
- [插头DP自我总结]
- 如何获取 WebAssembly 代码
- 布谷鸟哈希函数的参数_系统学习hash算法(哈希算法)
- Huber损失最小化学习法
- Bailian3175 验证极限【数学】
- 数据库事务的四大特性以及事务的隔离级别 1
- 环保线绕电阻器的主要特性和应用分析
- linux跟单片机的区别,树莓派和单片机的区别
- 手机实名检测 API数据接口
- 最强GTD时间管理工具:OmniFocus Pro 3 for Mac支持big sur
- VMware虚拟机安装MAC OS原版系统,轻松体验苹果操作系统
- 跟我20天学Java:01-计算机基础以及JDK、IDEA等安装详解
- 婚恋交友诈骗案例,交友要谨慎
- Qt5编译使用QFtp
- lanczos bidiagonalization(1)