MySQL table engine modification

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.