您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php mysql数据库复制的实现代码

2024/6/1 8:23:17发布18次查看
-- -- 数据库: `db_copy_old` -- -- -- 表的结构 `article` -- create table if not exists `article` ( `id` int(20) not null auto_increment, `title` text character set utf8 not null, `content` text character set utf8 not null, primary key (`id`) ) engine=innodb default charset=gbk auto_increment=4 ; -- -- 转存表中的数据 `article` -- insert into `article` (`id`, `title`, `content`) values (1, '测试001', '内容001'), (2, '测试002', '内容002'), (3, '测试003', '内容003');
复制代码
2,将数据库db_copy_old中的表article中数据导入数据库db_copy_new中的表article_new中,以实现数据库表之间的复制:
create table article_new like db_copy_old.article;insert article_new select * from db_copy_old.article;
复制代码
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product