如何在 MySQL 中安裝或啟用 innoDB?


為在 MySQ 中啟用 innoDB,您需要反覆檢查 my.ini 檔案。但是,在 MySQL 8 版本中,預設儲存引擎為 innoDB。從 my.ini 檔案中確認相同的內容 −

您甚至可以在建立表時設定 −

mysql> create table DemoTable
   (
   StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
   StudentFirstName varchar(100),
   StudentLastName varchar(100),
   StudentAge int
   ) ENGINE=InnoDB;
Query OK, 0 rows affected (1.66 sec)

現在讓我們執行一個查詢,以檢查特定表引擎的型別 −

mysql> select table_name,engine from information_schema.tables where table_name="DemoTable";

這將生成以下輸出 −

+--------------+--------+
| TABLE_NAME   | ENGINE |
+--------------+--------+
| DemoTable    | InnoDB |
+--------------+--------+
1 row in set (0.16 sec)

更新於: 22-8-2019

1 千 + 瀏覽量

開啟你的職業生涯

完成課程即可獲得認證

開始
廣告