1. Modify the table creation engine
Mysql> Create Table test_2 (-> name varchar (10),-> year int (10)-> engine = InnoDB; --> specify the default Engine Query OK when creating a table, 0 rows affected( 0.10 Sec) mysql> show create table test_2 \ G **************************** 1. row *************************** table: test_2create table: create Table 'test _ 2' ('name' varchar (10) default null, 'Year' int (10) default null) engine = InnoDB default charset = latin11 row in SET (0.00 Sec) mysql> show tables; + ------------------ + | tables_in_excise | + ------------------ + | test1 | test_1 | + ------------------ + 2 rows in SET (0.00 Sec) mysql> show create table test_1 \ G **************************** 1. row *************************** table: test_1create table: create Table 'test _ 1' ('name' varchar (20) default null, 'Year' int (5) default null) engine = MyISAM default charset = Latin1 --> the default table engine is MyISAM; 1 row in SET (0.00 Sec) mysql> alter table test_1 type = InnoDB; --> modify the table data engine; query OK, 0 rows affected, 1 warning (0.11 Sec) records: 0 duplicates: 0 Warnings: 0 mysql> show create table test_1 \ G **************************** 1. row *************************** table: test_1create table: create Table 'test _ 1' ('name' varchar (20) default null, 'Year' int (5) default null) engine = InnoDB default charset = Latin1 --> the data engine of the table is changed to InnoDB; 1 row in SET (0.00 Sec) mysql>
2,
Mysql> show engines; --> View MySQL support engine + ------------ + --------- + engines + -------------- + ------ + ------------ + | engine | Support | comment | transactions | XA | savepoints | + ------------ + --------- + Summary + -------------- + ------ + ------------ + | mrg_myisam | Yes | collection of identical MyISAM tables | no | CSV | Yes | CSV storage engine | no | MyISAM | default | default engine as of MySQL 3.23 With great performance | no | InnoDB | Yes | supports transactions, row-level locking, and foreign keys | Yes | memory | Yes | hash based, stored in memory, useful for temporary tables | no | + ------------ + --------- + rows + -------------- + ------ + ------------ + 5 rows in SET (0.00 Sec) mysql>