MySQL Modify code (database, table, field)

Source: Internet
Author: User

    • View individual encodings
      View field codes show full COLUMNS from Park_car_user;
      View database Fields
      SHOW CREATE DATABASE db_name;
      To view the encoding of a table
      SHOW CREATE TABLE tbl_name;
    • Modify Database Encoding
[Client]  default-character-set=  GBK Port=3306 [Server]  default-character-set=  GBK Port=3306 [MySQL]  default-character-set=  GBK [mysqld]Port=3306Basedir=C:/Program Files/Mysql/Mysql/DataDir=C:/Program Files/Mysql/Mysql/Data/default-character-Set=GBKdefault-Storage-Engine=INNODB

    • Modifying the encoding of a table
ALTER TABLE DEFAULT CHARACTER SET [COLLATE collation_name];
    • Modify field Encoding
Modify the encoding of all fields in the table to UTF8
ALTER TABLE CONVERT  to CHARACTER SET UTF8;

MySQL Modify code (database, table, field)

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.