In MySQL, database garbled characters can generally be fixed by setting the character set, but garbled characters can appear at various stages, so this article summarizes the various stages of garbled characters and the corresponding methods. Add charset settings when creating a database/table Building a database Create a table Client display locale Check whether the locale setting is UTF8. Generally, there is no problem on the server side, only on the client side. Or there may be problems with some clients, which is often caused by problems with the client display settings.
mysql settings Use show variables like '%character%' to confirm. Generally, modifying character_set_database and character_set_server can only modify the settings in the current session. Use the mysql command to set the character set within the session
Local settings It only works in the current session. The setting method is: Global Settings The setting method for multiple sessions to work is: Of course, the session mode will become invalid after the database is restarted, and needs to be persisted. The same setting can be set in the MySQL configuration file my.cnf. In this way, when creating a database or creating a database table, utf8 is specified by default. If it is a pure display problem, it may often be due to the character_set_results setting. Use show variables like '%character%' to confirm. If the setting is incorrect, you can use the following method to solve it Database data export Generally, the following command is used to export the database using mysqldump If garbled characters appear, you can add the following Option If it contains blob type, you need to use the hex-blob option to export mysqldump Database data import If there are problems when importing, you can also consider adding character-level settings You can also use the following method and execute the following command before importing Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Detailed explanation of the new features of ES9: Async iteration
>>: Detailed explanation of common commands for network configuration of containers in Docker
Here are 10 tips on how to design better-usable w...
Table of contents background explore Summarize ba...
This article shares the specific code of the pull...
Table of contents question Server layer and stora...
Table of contents 1. Node.js and Vue 2. Run the f...
1. First of all, we need to distinguish between t...
Table of contents Preface Background Implementati...
Table of contents Example Code Rendering Code Ana...
1. Install Apache $ sudo apt update && su...
Web design is both a science and an art. Web desi...
How to host two or more sites on the popular and ...
When I was at work today, the business side asked...
public function json_product_list($where, $order)...
<br />This web page production skills tutori...
Table of contents 1. Unzip 2. Create a data folde...