要在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) );
让我们使用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更改为动态的查询:
mysql> alter table DemoTable ROW_FORMAT=DYNAMIC; Records: 0 Duplicates: 0 Warnings: 0