English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

كيفية إنشاء جدول MySQL باستخدام محرك التخزين InnoDB؟

لإنشاء جدول باستخدام محرك 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         | Null | 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".

تعليمية Elasticsearch