How to modify the character encoding for MySQL 5.6.24 uncompressed version (free install or zip version)

Source: Internet
Author: User
Tags change settings dedicated server

"Today it took nearly 3 hours to solve the problem of the default encoding for this character. Due to the different versions, the method of modification on the web is not applicable to this version. This version of the modified character encoding is recorded as follows for others to refer to "

1.

When we extract the zip file format to the specified directory and complete the basic Environment configuration, a file named "My-default.ini" will be found when you open MySQL 5.6.24. We open the file with Notepad will find that there is no "default-character-set = xxx" or "character_set_server=xxx", what is going on? Many of the methods on the net are directly modify this sentence of xxx for UTF8, not urgent, below please see the second step:

2.

Copy the file and name it "My.ini" so that there are two. ini files in the root directory, one is My-default.ini, and the other is My.ini. Next we just need to modify the contents of the My.ini inside the line. Take a look at the third step:

3.

Modify "My.ini",

Add Character_set_server=utf8 under [mysqld], note that "UTF8" is not "utf-8" and there are no punctuation marks behind it;

Add three more lines after the phrase "sql_mode=no_engine_substitution,strict_trans_tables":

[Client]
port=3306
Default-character-set=utf8

4.

After the above three steps will be OK. After saving, restart the server, after logging in the command line input: "Show variables like ' char% ';" To see the default character set as shown:

5.

My "My.ini" code, the Red Code area is the place to modify:

# for advice The change settings
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# * * * Don't EDIT this FILE. It ' s a template which'll be copied to the
# * * * default location during install, and would be replaced if you
# * * * * Upgrade to a newer version of MySQL.

[Mysqld]

# Remove Leading # and set to the amount of RAM for the most important data
# Cache in MySQL. Start at 70% of all RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove Leading # to turn on a very important data integrity option:logging
# Changes to the binary log between backups.
# Log_bin

# These is commonly set, remove the # and set as required.
Basedir = D:\mysql-5.6.24-winx64
DataDir = D:\mysql-5.6.24-winx64\data
Port = 3306
# server_id = ...
Character_set_server=utf8

# Remove Leading # To set options mainly useful for reporting servers.
# The server defaults is faster for transactions and fast selects.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

Sql_mode=no_engine_substitution,strict_trans_tables

[Client]
port=3306
Default-character-set=utf8

How to modify the character encoding for MySQL 5.6.24 uncompressed version (free install or zip version)

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.