概述
优秀教程推荐:
http://blog.csdn.net/qq_32144341/article/details/51318390
原来的编码:xinjin@xjPC:~$ 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
xinjin@xjPC:~$
修改后的编码:root@xjPC:~# 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
操作步骤:xinjin@xjPC:~$ sudo -s
[sudo] xinjin 的密码:
root@xjPC:~# service mysql stop
root@xjPC:~# gedit /etc/mysql/mysql.conf.d/mysqld.cnf
root@xjPC:~# gedit /etc/mysql/conf.d/mysql.cnf
root@xjPC:~# service mysql startroot@xjPC:~# 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
______________________________________________________________________________________________________
若是您觉得此博文有可以改进的地方或者内容过时了,请评论,我会仔细思考的。
注:此博文仅用于科研学习,如果侵犯到您的权益,请及时告知,我会做出相应的处理。
本文出自 “心静如水,志刚如磐.” 博客,请务必保留此出处http://xinjingzhigang.blog.51cto.com/12262830/1905567
ubuntukylin_mysql5.7基础 将mysql的默认编码修改为utf8
标签:ubuntukylin_mysql5.7基础 将mysql的默认编码修改为utf8
本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉
本文系统来源:http://xinjingzhigang.blog.51cto.com/12262830/1905567
最后
以上就是缓慢黄蜂为你收集整理的kylin默认mysql_ubuntukylin_mysql5.7基础 将mysql的默认编码修改为utf8的全部内容,希望文章能够帮你解决kylin默认mysql_ubuntukylin_mysql5.7基础 将mysql的默认编码修改为utf8所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复