Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> MySQL

วิธีเปลี่ยน Storage Engine ของตาราง MySQL

คำสั่ง MySQL ALTER TABLE สามารถเปลี่ยน storage engine ของตารางได้ดังนี้

mysql> ALTER TABLE Student ENGINE = 'InnoDB';
Query OK, 0 rows affected (0.90 sec)
Records: 0 Duplicates: 0 Warnings: 0

ตอนนี้ด้วยคำสั่งต่อไปนี้ เราสามารถตรวจสอบได้ว่า storage engine ได้เปลี่ยนแล้ว

mysql> SELECT ENGINE FROM information_schema.TABLES 
    -> WHERE TABLE_SCHEMA = 'tutorial' 
    -> AND TABLE_NAME = 'Student';
+--------+
| ENGINE |
+--------+
| InnoDB |
+--------+
1 row in set (0.01 sec)