How to modify the character encoding of mysql5.6.24 decompressed (Installation-free or zip)

Source: Internet
Author: User
Tags change settings dedicated server

How to modify the character encoding of mysql5.6.24 decompressed (Installation-free or zip)

1. When We decompress the zip file format to the specified directory and complete the basic environment configuration, open mysql 5.6.24 will find the file named [my-default.ini. When we open the file in notepad, we will find that there is no [default-character-set = xxx] or [character_set_server = xxx]. What is going on? Many of the methods provided on the Internet are to directly modify the xxx of this sentence to utf8, which is not urgent. Please refer to step 2 below:

2. copy the file and name it [my. ini], so there are two. ini files under the root directory, one is the my-default.ini, and the other is my. ini. Next, we only need to modify the content in my. ini. See Step 3:

3. Modify [my. ini ],

Add character_set_server = utf8 under [mysqld]. Note that [utf8] is not [UTF-8] and there is no punctuation mark behind it;

Add three more lines to the sentence "SQL _mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES:

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

4. After the above three steps, you will be OK. Save and restart the server. After logging on to the server, enter [show variables like 'Char % ';] in the command line to view the default Character Set, as shown in:

5. my. ini code. The red code area is the correct one:

# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the# *** default location during install, and will 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 total 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 are commonly set, remove the # and set as required.basedir = D:\mysql-5.6.24-winx64datadir = D:\mysql-5.6.24-winx64\dataport = 3306# server_id = .....character_set_server=utf8# Remove leading # to set options mainly useful for reporting servers.# The server defaults are 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 = 2Msql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES[client]port=3306default-character-set=utf8

 

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.