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 set utf-8 Encoding in mysql Database

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article introduces how to set up the utf-8 code in the mysql database, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Modify / etc/my.cnf or / etc/mysql/my.cnf file

[client] default-character-set = UTF8 [mysqld] default-storage-engine = INNODBcharacter-set-server = utf8collation-server = utf8_general_ci

Restart mysql and use the mysql client to check the encoding

Show variables like'% char%'

Use UTF-8 encoding when creating a new database

Create database 'test' default character set utf8 collate utf8_general_ci

Create tables, create fields using UTF-8 encoding

Create table test ('id' int (10) unsigned not null auto_increment,' name' varchar (50) character set utf8 default', primary key ('id')) default charset=utf8; on how to set the utf-8 code in the mysql database to share here, I hope the above content can be helpful 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