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

Operation method of character Encoding change in mysql Database

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

The following brings you about mysql database character encoding change operation method content, I believe you must have seen similar articles. What's the difference in what we bring to you? Let's take a look at the body part of it, believe that after reading mysql database character encoding change operation method you will certainly have some harvest.

1. If the mysql environment variable in cmd is not configured, set the MySQL environment variable in the system advanced settings.

2. Log in cmd as an administrator and enter mysql -u root -p123 on the console. Root is the default account and 123 is the database password.

3. show variables like 'char %'; view database encoding

Modify via MySQL command line: (encoding optional)

mysql> set character_set_client=utf8;

mysql> set character_set_connection=utf8;

mysql> set character_set_database=utf8;

mysql> set character_set_results=utf8;

mysql> set character_set_server=utf8;

mysql> set character_set_system=utf8;

mysql> set collation_connection=utf8;

mysql> set collation_database=utf8;

mysql> set collation_server=utf8;

4. Modify the character set of the database mysql>use mydb

mysql>alter database mydb character set utf8;

5. Create a database Specify the character set of the database

mysql>create database mydb character set utf8;

If the above does not have an effect

Find C:\ProgramData\MySQL\MySQL Server 5.7

my.ini file modification

[mysqld]

character_set_client=utf8

character_set_connection=utf8

character_set_results=utf8

......

For the above on mysql database character encoding change operation method, do you think it is what you want? If you want to know more about it, you can continue to pay attention to our industry information section.

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: 245

*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