Solution to garbled characters After mysql is reinstalled

Source: Internet
Author: User

After mysql is reinstalled, garbled code appears. Solution: view the current connection system parameters:

SHOW VARIABLES LIKE '%char%';mysql> show variables like 'char%';+--------------------------+----------------| Variable_name            | Value+--------------------------+----------------| character_set_client     | gbk| character_set_connection | gbk| character_set_database   | latin1| character_set_filesystem | binary| character_set_results    | gbk| character_set_server     | latin1| character_set_system     | utf8| character_sets_dir       | C:/+--------------------------+----------------8 rows in set (0.00 sec) mysql>

 

You can only set the database and server character sets to utf8 in the configuration file, otherwise it does not work in the command line: Stop command:
net stop mysql

 

Start command:
net start mysql

 

Mysql core configuration file my. ini [mysql] mainly configures the command line client parameter default-character-set = utf8 ---- affects the client, connection, result [mysqld], and configures the server parameter character-set-server = utf8 ----- to affect the database. when adding function functions to server mysql, Set
Set global log_bin_trust_function_creators = 1; specify the parameter; otherwise, the creation will fail.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.