Analysis of MYSQL engine and character settings _ MySQL

Source: Internet
Author: User
Analysis of MYSQL engine and character settings bitsCN.com
When creating a new TABLE that year, you can add an ENGINE or TYPE option to the create table statement to tell MySQL what TYPE of TABLE you want to CREATE: create table t (I INT) ENGINE = INNODB; create table t (I INT) TYPE = MEMORY; to convert a TABLE from one TYPE to another, you can use the ALTER TABLE statement, which indicates the new TYPE: alter table t ENGINE = MYISAM; alter table t TYPE = BDB; mysql tabulation character set 1. list all CHARACTER sets supported by MYSQL: show character set; 2. the current MYSQL server character set shows variables like 'character _ set _ % '; 3. the current MYSQL server character set verification settings show variables like 'co Llation _ % '; 4. displays the name of the show create database set in a database character set; 5. display the name of the show create table set in a data table; 6. modify the database character set alter database name default character set 'utf8'; 7. modify the character set of the data table alter table name default character set 'utf8'; 8. when creating a database, specify the character set create database name character set gbk collate gbk_chinese_ci; 9. specify the character set create table 'mysqlcode' ('id' TINYINT (255) unsigned not null AUTO_INCREMENT primary key, 'content' VARCHAR (255) Not null) TYPE = myisam character set gbk COLLATE gbk_chinese_ci; library character set, in my. the following code is missing in cnf: [client] default-character-set = utf8 [mysqld] default-character-set = utf8 10. modify the character set of the database mysql> use mydb mysql> alter database mydb character set UTF-8; create a character set of the specified database mysql> create database mydb character set UTF-8; modify it through the configuration file: modify/var/lib/mysql/mydb/db. optdefault-character-set = latin1default-collation = latin1_swedish_ci is Default-character-set = utf8default-collation = utf8_general_ci 11. MySQL server supports multiple character sets. You can use the show character set statement to list available CHARACTER sets: mysql> show character set. if the above code is not added, even if the encoding specified during MYSQL compilation and installation is UTF8, at the time of database creation, the default encoding is LATIN1, and the tables in the database are also LATIN1 due to the inheritance of the character set.
Author: DouglasLaubitsCN.com

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.