English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
InnoDBエンジンを使用してテーブルを作成するには、ENGINEコマンドを使用できます。これはテーブルを作成するクエリです。
mysql> create table EmployeeRecords - > ( - > EmpId int, - > EmpName varchar(100), - > EmpAge int, - > EmpSalary float - > ENGINE=INNODB;
上記でENGINEをINNODBに設定しました。
DESCコマンドを使用して、テーブルに関する詳細な説明を確認します。
mysql> DESC EmployeeRecords;
以下は出力です。
+-----------+--------------+------+-----+---------+-------+ | Field | Type | | Key | Default | Extra | +-----------+--------------+------+-----+---------+-------+ | EmpId | int(11) | YES | | NULL | | | | EmpName | varchar(100) | YES | | NULL | | | | EmpAge | int(11) | YES | | NULL | | | | EmpSalary | float | YES | | NULL | | | +-----------+--------------+------+-----+---------+-------+ 4 rows in set (0.05 sec)
テーブルがInnoDBで作成されているか確認します。
mysql> SHOW TABLE STATUS FROM business LIKE 'EmployeeRecords';
これは出力です-
+-----------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +-----------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ | employeerecords | InnoDB | 10 | Dynamic | 0 | 0 | 16384 | 0 | 0 | 0 | NULL | 2018-10-22 15:22:01 | NULL | NULL | utf8mb4_unicode_ci | NULL | | | +-----------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ 1 row in set (0.10 sec)
上記の出力では、「Engine」が「InnoDB」に表示されています。