In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how to change the default character set in mysql. I think it is very practical, so I share it with you. I hope you can get something after reading this article.
After starting mysql, log in to mysql as root
$mysql-u root-p
> show variables like 'character%'; # perform encoding display
+-+
| | Variable_name | Value |
+-+
| | character_set_client | latin1 |
| | character_set_connection | latin1 |
| | character_set_database | latin1 |
| | character_set_filesystem | binary |
| | character_set_results | latin1 |
| | character_set_server | latin1 |
| | character_set_system | utf8 |
| | character_sets_dir | / usr/share/mysql/charsets/ |
+-+
At some point, we continue to modify the encoding of the mysql default database to ensure that some migrated programs can be displayed properly. Edit the my.cnf file to modify the encoding, which can be set directly with Mysql Server Instance Config Wizard.
Modify 1 / etc/mysql/my.cnf file of 3 my.cnf under linux
Find the client configuration [client] and add below
The default character set of default-character-set=utf8 is utf8
Add when you find [mysqld]
The default character set of default-character-set=utf8 is utf8
Init_connect='SET NAMES utf8' (set to use utf8 encoding when connecting to mysql so that the database runs for utf8)
After modification, restart mysql and query show variables like 'character%'.
+-+
| | Variable_name | Value |
+-+
| | character_set_client | utf8 |
| | character_set_connection | utf8 |
| | character_set_database | utf8 |
| | character_set_filesystem | binary |
| | character_set_results | utf8 |
| | character_set_server | utf8 |
| | character_set_system | utf8 |
| | character_sets_dir | / usr/share/mysql/charsets/ |
+-+
The above is how to change the default character set in mysql. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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: 248
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.