Upgrade mysql4.0 to mysql5 (4.1) to solve Character Set Problems

Source: Internet
Author: User
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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.