请教一个关于备份的问题.
我以前用红帽子9 mysql4.0的数据库备份下的数据库都是一条一条的语句.
insert into table values (1,...);
insert into table values (2,...);
insert into table values (3,...);
但是现在用fedora6 数据库是安装系统时自带的mysql5.0 他备份的库中的语句是:
insert into table values (1,...),(2,...),(3,...);
我现在想要fedora下备份成第一种逐条的格式的该怎么弄.
再问一句是系统的原因还是库的原因?
yejr
周五, 2007/07/27 - 21:15
Permalink
mysqldump --help | grep
自己看看详细的信息。
MySQL方案、培训、支持
MySQL 用户组
liudan182
周一, 2007/07/30 - 09:07
Permalink
[root@localhost home]#
[root@localhost home]# mysqldump --help | grep 'extended-insert'
-e, --extended-insert
--quick, --extended-insert, --lock-tables, --set-charset,
--create-options, --quick, --extended-insert,
extended-insert TRUE
我试了几个,
mysqldump -e -u root -p radius radcheck >/home/rad.txt
mysqldump -u root -p radius radcheck --extended-insert >/home/rad.txt
mysqldump -u root -p radius radcheck >/home/rad.txt --extended-insert
好像备份的结果都不对.我那写错了吗?
备份结果:INSERT INTO `radcheck` VALUES (1,'atest','Password',':=','123456','','','2007-05-31 03:43:33','1990-01-01 00:00:00','1990-01-01 00:00:00','1990-01-01 00:00:00',0,0,0,0,'0.00','0',0,-1,'','2007-05-31 03:43:33','','','','0'),(2,'69789900','Password',':=','123456','','','2007-05-31 03:43:33','1990-01-01 00:00:00','2990-01-01 00:00:00','1990-01-01 00:00:00',0,0,0,0,'0.00','0',0,-1,'','2007-05-31 03:43:33','','','','0')
还是这样由一条语句完成的,我想他变成2条INSERT语句.
yejr
周一, 2007/07/30 - 09:16
Permalink
把这个仔细看看就有
把这个仔细看看就有答案了
http://imysql.cn/mysql_backup_and_recover
MySQL方案、培训、支持
MySQL 用户组
liudan182
周一, 2007/07/30 - 11:05
Permalink
[root@localhost home]#
[root@localhost home]# mysqldump -u root -ptsdradius \
> --extended-insert=false radius radcheck >/home/rad.txt
INSERT INTO `radcheck` VALUES (1,'atest','Password',':=','123456','','','2007-05-31 03:43:33','1990-01-01 00:00:00','1990-01-01 00:00:00','1990-01-01 00:00:00',0,0,0,0,'0.00','0',0,-1,'','2007-05-31 03:43:33','','','','0');
INSERT INTO `radcheck` VALUES (2,'69789900','Password',':=','123456','','','2007-05-31 03:43:33','1990-01-01 00:00:00','2990-01-01 00:00:00','1990-01-01 00:00:00',0,0,0,0,'0.00','0',0,-1,'','2007-05-31 03:43:33','','','','0');
非常感谢.
英文不好,用mysqldump --help没看懂.呵呵