Get the App
SLTechnology News&Howtos  ›  Database  › 

Operation method of character Encoding change in mysql Database

Shulou Source: shulou.com Published: 2022-06-01 18:11:41 10月05日 Update

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.

Tags: Data database characters encoding methods variables character sets environments different advanced above below content commands passwords console effects files articles more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Docker NVidia MariaDB Shulou Technology