查看複製的資料表

  1. 新的資料表的結構與原資料表完全一樣。
    MariaDB root@(none):dyw> show create table animals\G
    ***************************[ 1. row ]***************************
    Table        | animals
    Create Table | CREATE TABLE `animals` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `name` varchar(20) NOT NULL,
      `foot` tinyint(3) unsigned NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8
    
    1 row in set
    Time: 0.017s
    MariaDB root@(none):dyw> show create table clone_animals\G
    ***************************[ 1. row ]***************************
    Table        | clone_animals
    Create Table | CREATE TABLE `clone_animals` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `name` varchar(20) NOT NULL,
      `foot` tinyint(3) unsigned NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8
    
    1 row in set
    Time: 0.004s
    MariaDB root@(none):dyw> show create table clone1_animals\G
    ***************************[ 1. row ]***************************
    Table        | clone1_animals
    Create Table | CREATE TABLE `clone1_animals` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `name` varchar(20) NOT NULL,
      `foot` tinyint(3) unsigned NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8
    
    1 row in set
    Time: 0.002s
    
  2. 新的資料表的紀錄與原資料表完全一樣。
    MariaDB root@(none):dyw> select * from animals;
    +----+---------+------+
    | id | name    | foot |
    +----+---------+------+
    | 1  | dog     | 4    |
    | 2  | cat     | 4    |
    | 3  | chicken | 2    |
    | 15 | bird    | 2    |
    +----+---------+------+
    
    4 rows in set
    Time: 0.037s
    MariaDB root@(none):dyw> select * from clone_animals;
    +----+---------+------+
    | id | name    | foot |
    +----+---------+------+
    | 1  | dog     | 4    |
    | 2  | cat     | 4    |
    | 3  | chicken | 2    |
    | 15 | bird    | 2    |
    +----+---------+------+
    
    4 rows in set
    Time: 0.027s
    MariaDB root@(none):dyw> select * from clone1_animals;
    +----+---------+------+
    | id | name    | foot |
    +----+---------+------+
    | 1  | dog     | 4    |
    | 2  | cat     | 4    |
    | 3  | chicken | 2    |
    | 15 | bird    | 2    |
    +----+---------+------+
    
    4 rows in set
    Time: 0.022s