Get the App
SLTechnology News&Howtos  ›  Database  › 

The method of modifying Table character Encoding by mysql

Shulou Source: shulou.com Published: 2022-06-01 02:46:20 09月21日 Update

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.

Tags: Data datasheet character set method encoding table word query information content field database more good practical code article version status see Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Linux OPPO Reno MariaDB Apple