English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
MyISAM 엔진을 사용하여 MySQL 테이블을 생성하려면 ENGINE 명령어를 사용할 수 있습니다. 먼저 CREATE 명령어로 테이블을 생성해 보겠습니다。
mysql> create table StudentRecordWithMyISAM -> ( -> Id int, -> StudentName varchar(100), -> StudentAge int -> )ENGINE=MyISAM;
위에서 엔진을 'MyISAM'으로 설정했습니다。
테이블에 몇 개의 열이 있는지 확인하려면 DESC 명령어를 사용하십시오。
mysql> DESC StudentRecordWithMyISAM;
이하가 출력입니다。
+-------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------+------+-----+---------+-------+ | Id | int(11) | YES | | NULL | | | StudentName | varchar(100) | YES | | NULL | | | StudentAge | int(11) | YES | | NULL | | +-------------+--------------+------+-----+---------+-------+ 3 rows in set (0.00 sec)
테이블이 MyISAM과 함께 제공되는지 확인합니다。
mysql> SHOW TABLE STATUS FROM business LIKE 'StudentRecordWithMyISAM';
이하는 엔진이 MyISAM으로 명확히 표시된 출력입니다。
+-------------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+ | 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 | +-------------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+ | studentrecordwithmyisam | MyISAM | 10 | Dynamic | 0 | 0 | 0 | 281474976710655 | 1024 | 0 | 1 | 2018-10-22 15:47:01 | 2018-10-22 15:47:02 | NULL | utf8mb4_unicode_ci | NULL | | | +-------------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+ 1 row in set (0.14 sec)
MyISAM 테이블이 존재하는지 확인합니다。
mysql> SELECT TABLE_NAME, -> ENGINE -> FROM information_schema.TABLES -> WHERE TABLE_SCHEMA = 'business' and ENGINE = 'MyISAM';
이하가 출력입니다。
+-------------------------+--------+ | TABLE_NAME | ENGINE | +-------------------------+--------+ | studentrecordwithmyisam | MyISAM | +-------------------------+--------+ 1 row in set (0.00 sec)