MySQL uses SQL statements to view the encoding method of a table.

Source: Internet
Author: User

MySQL uses SQL statements to view the encoding method of a table.

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

Show create table allows you to view the SQL statement script for creating this table. Its basic syntax is:
Show create table <table Name>;

Let's use it to look at the create script of the test table:

mysql> show create table test;+-------+----------------------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table+-------+----------------------------------------------------------------------------------------------------------------------------------------------+| test | CREATE TABLE `test` ( `t_id` int(11) DEFAULT NULL, `t_name` varchar(50) NOT NULL, `t_password` char(32) DEFAULT 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 the default charset = latin1 indicates that the character encoding type of the test table is latin1.

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

In the above MySQL article, the encoding method for viewing a table using SQL statements is all the content that I have shared with you. I hope to give you a reference, and I hope you can provide more support to the customer's house.

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.