ubuntukylin_mysql5.7 base modifies MySQL's default encoding to UTF8

Source: Internet
Author: User

Town Yard text:
The Confucian School of the practical and practical, line Buddhism Purdue sentient beings, the monastic Kangsheng fidelity, understanding of the easy to change the image. To science and technology to shine a good law, the achievement of a conscience blog.
______________________________________________________________________________________________________
Operating System:ubuntukylin 16.04 LTS 64bit
Mysql:ver 14.14 Distrib 5.7.17, for Linux (x86_64) using Editline Wrapper


Excellent tutorials recommended:

http://blog.csdn.net/qq_32144341/article/details/51318390



The original code:

[Email protected]:~$ mysql -u root -p enter password:  Welcome to 
The mysql monitor.  commands end with ; or \g. Your mysql connection id is 10 server version: 5.7.17-0ubuntu0.16.04.1 

(Ubuntu) copyright  (c)  2000, 2016, Oracle and/or its affiliates. All 

Rights reserved.
Oracle is a registered trademark of oracle corporation and/or its

Affiliates. other names may be trademarks of their respective owners. type  ' help; '  or  ' \h '  for help. Type  ' \c '  to clear the current input

 statement.
mysql> show variables like  ' character% '; +--------------------------+----------------------------+ | variable_name             | value          
            | +--------------------------+----------------------------+ | character_set_client      | utf8                        | | character_set_connection | utf8                         | | character_set_database   | latin1                      | |  character_set_filesystem | binary                      | | character_set_results    | utf8                        | | character_ set_server     | latin1                      | | character_set_system      | utf8                        | | character_sets_dir   
    | /usr/share/mysql/charsets/ |

+--------------------------+----------------------------+ 8 rows in set  (0.01 sec) Mysql> exit Bye [email protected]:~$


The modified encoding:

[Email protected]:~# mysql -u root -p enter password:  Welcome to 
The mysql monitor.  commands end with ; or \g. Your mysql connection id is 4 server version: 5.7.17-0ubuntu0.16.04.1  ( Ubuntu) copyright  (c)  2000, 2016, oracle and/or its affiliates. all

 rights reserved.
Oracle is a registered trademark of oracle corporation and/or its

Affiliates. other names may be trademarks of their respective owners. type  ' help; '  or  ' \h '  for help. Type  ' \c '  to clear the current input

 statement.
mysql> 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/ |

+--------------------------+----------------------------+ 8 rows in set  (0.00 sec) Mysql> exit Bye



Operation Steps:

[Email protected]:~$ sudo-s
[sudo] xinjin password:


[Email protected]:~# service MySQL Stop


[Email protected]:~# gedit/etc/mysql/mysql.conf.d/mysqld.cnf

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/8E/8C/wKiom1jEx8PiMCobAAAfxcToqFE549.png "title=" 2017-03-13 15-55-48 screen. png "alt=" Wkiom1jex8pimcobaaafxctoqfe549.png "/>


[Email protected]:~# gedit/etc/mysql/conf.d/mysql.cnf

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/8E/8C/wKiom1jEx83CbE9nAAAumpmCBQM488.png "title=" 2017-03-13 15-55-22 screen. png "alt=" Wkiom1jex83cbe9naaaumpmcbqm488.png "/>

[Email protected]:~# service MySQL start
[Email protected]:~# mysql -u root -p enter password:  Welcome to 
The mysql monitor.  commands end with ; or \g. Your mysql connection id is 4 server version: 5.7.17-0ubuntu0.16.04.1  ( Ubuntu) copyright  (c)  2000, 2016, oracle and/or its affiliates. all

 rights reserved.
Oracle is a registered trademark of oracle corporation and/or its

Affiliates. other names may be trademarks of their respective owners. type  ' help; '  or  ' \h '  for help. Type  ' \c '  to clear the current input

 statement.
mysql> 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/ |

+--------------------------+----------------------------+ 8 rows in set  (0.00 sec) Mysql> exit Bye




______________________________________________________________________________________________________
If you think this blog post can be improved or the content is outdated, please comment, I will think carefully.
Note: This blog post is only used for scientific research, if the infringement of your interests, please inform me, I will make the appropriate treatment.




This article is from the "calm mind like water, chi just like the pan." Blog, be sure to keep this source http://xinjingzhigang.blog.51cto.com/12262830/1905567

ubuntukylin_mysql5.7 base modifies MySQL's default encoding to UTF8

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.