MYSQL 8 基本操作之07 (存储引擎)

  1. 查看当前默认存储引擎
#  1:default_storage_engine 表示永久表(permanent tables)的默认存储引擎。
#  2:default_tmp_storage_engine 表示临时表的默认存储引擎。

[email protected] : (none)【12:01:28】6 SQL-> show variables like '%storage_engine%';
+---------------------------------+-----------+
| Variable_name                   | Value     |
+---------------------------------+-----------+
| default_storage_engine          | InnoDB    |
| default_tmp_storage_engine      | InnoDB    |
| disabled_storage_engines        |           |
| internal_tmp_mem_storage_engine | TempTable |
+---------------------------------+-----------+

#查看表所用的存储引擎
[email protected] : (none)【12:04:03】8 SQL->SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE,ENGINE FROM information_schema.TABLES where TABLE_SCHEMA='testdb';
+--------------+-----------------+------------+--------+
| TABLE_SCHEMA | TABLE_NAME      | TABLE_TYPE | ENGINE |
+--------------+-----------------+------------+--------+
| testdb       | dept            | BASE TABLE | InnoDB |
| testdb       | emp             | BASE TABLE | InnoDB |
| testdb       | emp1            | BASE TABLE | InnoDB |
| testdb       | mp_user         | BASE TABLE | InnoDB |
| testdb       | my_account      | BASE TABLE | InnoDB |
| testdb       | my_account_tran | BASE TABLE | InnoDB |
| testdb       | tb_log          | BASE TABLE | InnoDB |
+--------------+-----------------+------------+--------+

#修改表的春初引擎(如下改成 InnoDB)
alter table table_name engine=innodb;
  1. 当前数据库支持的存储引擎
[email protected] : (none)【12:04:42】9 SQL->show engines \G
*************************** 1. row ***************************
      Engine: FEDERATED
     Support: NO
     Comment: Federated MySQL storage engine
Transactions: NULL
          XA: NULL
  Savepoints: NULL
*************************** 2. row ***************************
      Engine: MEMORY
     Support: YES
     Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 3. row ***************************
      Engine: InnoDB
     Support: DEFAULT
     Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
          XA: YES
  Savepoints: YES
*************************** 4. row ***************************
      Engine: PERFORMANCE_SCHEMA
     Support: YES
     Comment: Performance Schema
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 5. row ***************************
      Engine: MyISAM
     Support: YES
     Comment: MyISAM storage engine
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 6. row ***************************
      Engine: MRG_MYISAM
     Support: YES
     Comment: Collection of identical MyISAM tables
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 7. row ***************************
      Engine: BLACKHOLE
     Support: YES
     Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 8. row ***************************
      Engine: CSV
     Support: YES
     Comment: CSV storage engine
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 9. row ***************************
      Engine: ARCHIVE
     Support: YES
     Comment: Archive storage engine
Transactions: NO
          XA: NO
  Savepoints: NO

你可能感兴趣的:(MYSQL 8 基本操作之07 (存储引擎))