I won't talk about the software upgrade, just about database migration.
I won't talk about the software upgrade, just about database migration.
1. Export the table mysqldump-no-data-uroot-p database> struct. SQL from 4.0
2. Export data mysqldump-no-create-info = true-extended-insert = false-u root-p database> data. SQL
3. Use vi to edit struct. SQL and use the last-line command.
: % S/) TYPE = MyISAM;/) ENGINE = MyISAM default charset = gbk;/g
: % S/) TYPE = HEAP. * $/) ENGINE = memory default charset = gbk;/g
4. Import struct. SQL, data. SQL
Mysql 4.0 and earlier versions support only one character set latin1. Since mysql 4.1, it supports many character sets, such as gbk and utf8 (non-UTF-8.
The storage of Multi-byte character sets such as gbk and utf8 has also changed. For example, in latin1, the Chinese character length is 2, and in gbk or utf8, the Chinese character length is 1. That is to say, the original varchar (32) can only store 16 Chinese characters, and now can save 32.
URL: