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

MySQL character Encoding Settings

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

Share

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

View encodings through show variables like 'character_set%%';

You can modify the encoding of mysql in the following ways:

1. Modify my.ini (under windows) or / etc/my.cnf (under linux) through configuration file

Add the following respectively

[mysqld] character_server_set= utf8[mysql] default-character-set=utf8 [mysql.server] default-character-set= utf8[mysql _ safe] default-character-set=utf8 [client] default-character-set=utf8

two。 Set the encoding create database test character set utf8;3 when creating the database. Set the encoding create table test (id int primary key) DEFAULT charset=utf8;4 when creating the table. Modify the database code alter database test character set utf8;5. Modify the table default code alter table test character set utf8;6. Modify field code alter table test modify col_name varchar (50) CHARACTER SET utf8

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