Enterprise Case--production link change MySQL character set

Source: Internet
Author: User

To view the database character set:

Show database Create dbname \g;

To view the database table character set:

Show table Create Tbname \g;

To view the existing database character set settings:

Show variables like ' character_set% ';

To temporarily modify a character set:

Set names Latin1|utf8;

-------------------------------------------

Non-production environment:

ALTER DATABASE character xxx;

ALTER TABLE tbname character xxx;

Premise: The character set data that has already been recorded cannot be modified,

Production environment Change Character set:

have been running for some time the library modified

Modify the process:

1. Export Table structure

mysqldump-d parameters

2, modify the table structure SQL content, replace the character set keyword such as Latin1 changed to UTF8

3, export the table data, this time can not write data

--no-create-info Export only creation statements

4. Modify data SQL file Latin1 to UTF8

5. Create the specified library

6. Create the specified table

7. Import the specified data

Enterprise Case--production link change MySQL character set

Related Article

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.