将MySQL中的row_format修改为dynamic?
要将MySQL中的row_format修改为dynamic,可按以下语法进行操作:
ALTER TABLE yourTableName ROW_FORMAT=DYNAMIC;
让我们首先创建一个表:
mysql> create table DemoTable
(
CustomerId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
CustomerName varchar(200),
CustomerAge int,
CustomerAddress varchar(200)
);
Query OK, 0 rows affected (0.73 sec)
使用DESC命令检查表的描述信息如下:
mysql> desc DemoTable;
这将产生以下输出:
+-----------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------------+------+-----+---------+----------------+
| CustomerId | int(11) | NO | PRI | NULL | auto_increment |
| CustomerName | varchar(200) | YES | | NULL | |
| CustomerAge | int(11) | YES | | NULL | |
| CustomerAddress | varchar(200) | YES | | NULL | |
+-----------------+--------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)
以下是将row_format修改为dynamic的查询:
mysql> alter table DemoTable ROW_FORMAT=DYNAMIC;
Query OK, 0 rows affected (1.05 sec)
Records: 0 Duplicates: 0 Warnings: 0
阅读更多:MySQL 教程