The encoding method for viewing a table using SQL statements in Mysql _mysql

Source: Internet
Author: User

In MySQL, how do you use SQL statements to view the encoding of a table? We use show create TABLE, a SQL statement, to solve this problem.

Show CREATE table can view the SQL statement script that created the table, and its basic syntax is:
Show CREATE table < table name >;

We use it to look at the Create script for the test table:

Mysql> Show create table test;
+-------+---------------------------------------------
---------------------------------------------------- --
-------------------------------------------+
| Table | Create Table
+-------+---------------------------------------------
----------------------------------- -------------------
-------------------------------------------+
| test | CREATE TABLE ' test ' (
 ' t_id ' int () DEFAULT null,
 ' t_name ' varchar NOT NULL,
 ' T_password ' char () DEF Ault null,
 ' T_birth ' date default NULL
) engine=innodb DEFAULT charset=latin1 |
+-------+---------------------------------------------
--------------------------------------------------- ---
-------------------------------------------+
1 row in Set (0.00 sec)

From this result we can see that there is this sentence: DEFAULT charset=latin1, which indicates that the character encoding type of the test table is: Latin1.

Also, we can see from this result that the engine for the current table is the InnoDB engine. This information is also very important.

Above this MySQL use SQL statement to see a table coding method is small series to share all the content, hope to give you a reference, but also hope that we support cloud habitat community.

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.