-
- --
- -- Database: `db_copy_old`
- --
- --
- -- Table structure `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;
- - -
- -- Dump the data in the table `article`
- --
- INSERT INTO `article` (`id`, `title`, `content`) VALUES
- (1, 'Test001', 'Content001') ,
- (2, 'Test 002', 'Content 002'),
- (3, 'Test 003', 'Content 003');
Copy the code
2 to copy the data in the table article in the database db_copy_old Import the table article_new in the database db_copy_new to achieve replication between database tables:
-
- CREATE TABLE article_new LIKE db_copy_old.article;
- INSERT article_new SELECT * FROM db_copy_old.article;
Copy code
|