[root@kvm3 ~]# grep Database dump.txt -- Host: localhost Database: dyw [root@kvm3 ~]# grep Table dump.txt -- Table structure for table `animals`
[root@kvm3 ~]# mysql -uroot -p123qwe dyw < dump.txt
mariadb root@localhost: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.033s
auto_increment
。
mariadb root@localhost:dyw> desc animals; +-------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | <null> | auto_increment | | name | varchar(20) | NO | | <null> | | | foot | tinyint(3) unsigned | NO | | <null> | | +-------+---------------------+------+-----+---------+----------------+ 3 rows in set Time: 0.033s