Computer >> 컴퓨터 >  >> 프로그램 작성 >> MySQL

MySQL 테이블의 엔진을 표시하는 방법은 무엇입니까?

<시간/>

MySQL 테이블이 MyISAM 또는 InnoDB 엔진을 사용하고 있는지 확인하려면 아래 구문을 사용할 수 있습니다.

아래 구문은 여러 테이블에 사용할 수 있습니다 -

show table status from yourDatabaseName;

다음은 특정 테이블에 사용할 수 있는 구문입니다. 즉, 테이블의 엔진을 알기 위해 -

show table status from yourDatabaseName Like ‘yourTableName’.

다음은 모든 테이블의 엔진을 표시하는 쿼리입니다 -

mysql> show table status from sampleTest;

다음은 출력입니다 -

+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+
| 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   |
+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+
| datetimedemo | InnoDB | 10      | Dynamic    | 0    | 0              | 16384       | 0               | 0             | 0         | NULL          | 2018-12-05 09:22:54 | NULL                | NULL  | utf8mb4_0900_ai_ci      | NULL      |               |         |
| primarydemo  | InnoDB | 10      | Dynamic    | 0    | 0              | 16384        | 0              | 0             | 0          | NULL         | 2018-12-05 09:23:34 | NULL                | NULL   | utf8mb4_0900_ai_ci | NULL |                         |         |
| student      | MyISAM | 10      | Dynamic    | 0    | 0         |    | 281474976710655 | 1024 | 0 | 1 | 2018-12-05 09:22:22 | 2018-12-05 09:22:23 | NULL | utf8mb4_0900_ai_ci | NULL | | |
+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+
3 rows in set (0.19 sec)

다음은 특정 테이블에 대한 엔진 유형을 표시하는 쿼리입니다 -

mysql> show table status from sampletest Like 'student';

다음은 "student" 테이블에 대해서만 엔진을 표시하는 출력입니다 -

+---------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+
| 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 |
+---------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+
| student | MyISAM | 10      | Dynamic    | 0    | 0              | 0 | 281474976710655 | 1024 | 0 | 1 | 2018-12-05 09:22:22 | 2018-12-05 09:22:23 | NULL | utf8mb4_0900_ai_ci | NULL | | |
+---------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+
1 row in set (0.00 sec)