从A主机备份到B主机mysqldump -uroot -p vw>vw.sql现备份数据库文件,需要恢复到目标机B,B的数据库版本为5.5.23,A机器的mysql版本为5.0.22
- mysql>source /root/vw.sql;
- ……………………………………………………
- Query OK, 6748 rows affected (0.13 sec)
- Records: 6748 Duplicates: 0 Warnings: 0
- Query OK, 6807 rows affected (0.12 sec)
- Records: 6807 Duplicates: 0 Warnings: 0
- Query OK, 6752 rows affected (0.13 sec)
- Records: 6752 Duplicates: 0 Warnings: 0
- Query OK, 6659 rows affected (0.13 sec)
- Records: 6659 Duplicates: 0 Warnings: 0
- Query OK, 6676 rows affected (0.13 sec)
- Records: 6676 Duplicates: 0 Warnings: 0
- Query OK, 6583 rows affected (0.12 sec)
- Records: 6583 Duplicates: 0 Warnings: 0
- Query OK, 6598 rows affected (0.13 sec)
- Records: 6598 Duplicates: 0 Warnings: 0
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near "" at line 1
- mysql>
在B机器上面导入的时候出现以上错误,排除数据库本身问题,后来通过navicat工具备份A的数据,再次导入机器B却成功了。经过测试发现是字符集问题导致。解决办法如下在A机器上面备份,使用如下命令,恢复到B机器,测试OK。
- mysqldump -uroot --default-character-set=utf8 -p vw>vw.sql
Oracle不完全备份系列MySQL5.5 自动分区脚本相关资讯 MySQL教程
- 30分钟带你快速入门MySQL教程 (02月03日)
- MySQL教程:关于I/O内存方面的一些 (01月24日)
- CentOS上开启MySQL远程访问权限 (01/29/2013 10:58:40)
| - MySQL教程:关于checkpoint机制 (01月24日)
- MySQL::Sandbox (04/14/2013 08:03:38)
- 生产环境MySQL 5.5.x单机多实例配 (11/02/2012 21:02:36)
|
本文评论 查看全部评论 (0)