| Handler_write | 0 |
2 修改frm文件
通过修改frm文件的方式来提高修改表结构效率的步骤大概如下
1. 备份相关的数据库文件
2. 创建一张和旧表完全相同的表结构
mysql>create table dictionary_new like dictionary;
3. 执行FLUSH TABLES WITH READ LOCK. 所有的表都被关闭
mysql> alter table dictionary_new
-> modify column mean varchar(30)default 'DEFAULR#';
mysql> flush table with read lock;
5. 把dictionary_new.frm文件重名为dictionary.frm
6. 执行UNLOCK TABLES
mysql> unlock tables;
mysql> insert into dictionary(word) values('Random');
mysql> select * from dictionarywhere word='Random';
从下面的结果可以看出,默认值已经被改掉,且不涉及到内容的改变
+--------+--------+----------+
| id | word | mean |
+--------+--------+----------+
| 110004 |Random | DEFAULR# |
+--------+--------+----------+
7. Drop dictionary_new