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

How to modify character set in Mysql

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

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to modify the character set in Mysql. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Modify the database character set:

[sql]

ALTER DATABASE db_name DEFAULT CHARACTER SET character_name [COLLATE...]

Change the default character set and all character columns (CHAR,VARCHAR,TEXT) to the new character set:

[sql]

ALTER TABLE tbl_name CONVERT TO CHARACTER SET character_name [COLLATE...]

Such as: ALTER TABLE logtest CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci

Simply modify the default character set of the table:

Www.2cto.com

[sql]

ALTER TABLE tbl_name DEFAULT CHARACTER SET character_name [COLLATE...]

Such as: ALTER TABLE logtest DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

Modify the character set of the field:

[sql]

ALTER TABLE tbl_name CHANGE c_name c_name CHARACTER SET character_name [COLLATE...]

Such as: ALTER TABLE logtest CHANGE title title VARCHAR (100) CHARACTER SET utf8 COLLATE utf8_general_ci

View the database code:

[sql]

SHOW CREATE DATABASE db_name

View the table encoding:

[sql]

SHOW CREATE TABLE tbl_name

View field codes:

[sql]

SHOW FULL COLUMNS FROM tbl_name

Www.2cto.com

Restart the Mysql service after modifying the character set:

Under Windows:

Start-> run-> cmd

Stop: net stop mysql

Launch: net start mysql

Premise that MYSQL is already installed as a windows service

Below:

I. start-up mode

1. Start with service: service d start

2. Start with mysqld script: / etc/inint.d/mysqld start

3. Start with safe_mysqld: safe_mysqld&

2. Stop www.2cto.com

1. Start with service: service mysqld stop

2. Start with mysqld script: / etc/inint.d/mysqld stop

3 、 mysqladmin shutdown

3. Restart

1. Start with service: service mysqld restart

2. Start with mysqld script: / etc/inint.d/mysqld restart

On how to modify the character set in Mysql to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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