linux mysql 5.7 修改默认字符集为utf8
2016-05-19 16:35
441 查看
1、通过 SHOW VARIABLES LIKE 'character_set_%'; 查看mysql字符集情况
2、日狗的 latin1 是很多语言乱码的主要原因,通过修改my.cnf 的方法,一劳永逸的解决乱码问题,两处修改的地方
不知道 my.cnf 文件在哪里,可以使用 whereis my.cnf 命令查找
mysql> show variables like "%char%"; +--------------------------+---------------+ | 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 | latin1 | | character_set_system | utf8 | +--------------------------+-------------+
2、日狗的 latin1 是很多语言乱码的主要原因,通过修改my.cnf 的方法,一劳永逸的解决乱码问题,两处修改的地方
不知道 my.cnf 文件在哪里,可以使用 whereis my.cnf 命令查找
# 修改处1:添加以下2行 [client] default-character-set=utf8 [mysqld] #skip-grant-tables #skip-networking # # 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 # # 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 = 2M datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid # 修改处2:添加以下3行 default-storage-engine=INNODB character-set-server=utf8 collation-server=utf8_general_ci
相关文章推荐
- [转载]linux查询历史记录命令history的用法介绍
- linux查看磁盘是否SSD盘
- linux内核启动第一阶段分析
- linux 权限
- 分布式存储 CentOS6.5虚拟机环境搭建FastDFS-5.0.5集群
- Android-SDK-For-Linux常用命令
- 【Linux】Linux系统下find指令详细用法与示例
- MAC ZOC远程访问Linux
- Linux下怎么将自己编写的Python模块添加到PYTHONPATH上
- Linux下Git和GitHub环境的搭建
- linux 线程互斥
- CentOS 7中如何安装mysql server
- ls
- linux下面/usr/local和opt目录有何区别
- ls
- linux格式化磁盘命令
- centos下二进制免编译安装mysql
- centos python tab 补全
- linux(ubuntu)之android开发日记
- linux rsync安装配置