Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of modifying Table character Encoding by mysql

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how mysql modifies the character encoding of a table. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

Mysql modifies the character encoding of the table: use DEFAULT to modify the character set, the code is [ALTER TABLE t_text DEFAULT CHARACTER SET utf8mb4;6, modify the character set of the nickname field in the data table t_text:].

Mysql method to modify table character encoding:

1. Query the version of MySQL:

SELECT VERSION ()

2. Query the character set currently used by MySQL:

SHOW VARIABLES LIKE'% character%'

3. Query the status information of the specified data table of the specified database (db_test is the database, t_text is the data table):

SHOW TABLE STATUS FROM `db_ test`LIKE'% tweet%'

4. View the column information of the data table:

SHOW FULL COLUMNS FROM t_text

5. Modify the character set of the data table t_text:

ALTER TABLE t_text DEFAULT CHARACTER SET utf8mb4;6, modify the character set of the nickname field in the data table t_text: ALTER TABLE t_text CHANGE nickname nickname VARCHAR (256) CHARACTER SET utf8mb4 NOT NULL; thank you for reading! On the mysql modification table character coding method to share here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report