centos 7.2中xampp mysql 数据字符集设置解决中文乱码
来源:互联网 发布:易语言手机轰炸机源码 编辑:程序博客网 时间:2024/06/06 03:17
centos 7.2中xampp mysql 数据字符集设置解决中文乱码
从终端进入mysql
[root@VM_172_94_centos etc]# /opt/lampp/bin/mysql -u root -pEnter password:Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 3Server version: 10.1.21-MariaDB Source distributionCopyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> show variables like 'char_%';
centos系统中mysql默认字符集配置
+--------------------------+----------------------------+| Variable_name | Value |+--------------------------+----------------------------+| character_set_client | latin1 || character_set_connection | latin1 || character_set_database | utf8 || character_set_filesystem | binary || character_set_results | latin1 || character_set_server | utf8 || character_set_system | utf8 || character_sets_dir | /opt/lampp/share/charsets/ |+--------------------------+----------------------------+
使用xampp集成环境搭建lamp,MySQL中的my.cnf目录为
/opt/lampp/etc
我的数据库为MariaDB 10.1.21
Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 3Server version: 10.1.21-MariaDB Source distribution
使用vim修改配置
[root@VM_172_94_centos etc]# vim /opt/lampp/etc/my.cnf
网上的修改方法,适用于MySQL5.7之前,修改之后会导致MySQL 无法启动
我的修改方法为
[client]default-character-set=utf8[mysqld]collation-server=utf8_unicode_ciinit-connect='SET NAMES utf8'character-set-server=utf8[mysql]default-character-set=utf8
重新启动MySQL
[root@VM_172_94_centos etc]# /opt/lampp/lampp restartRestarting XAMPP for Linux 5.6.30-1...XAMPP: Stopping Apache...ok.XAMPP: Stopping MySQL...ok.XAMPP: Stopping ProFTPD...ok.XAMPP: Starting Apache...ok.XAMPP: Starting MySQL...ok.XAMPP: Starting ProFTPD...ok.
登陆MySQL并查看字符集
[root@VM_172_94_centos etc]# /opt/lampp/bin/mysql -u root -pEnter password:Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 3Server version: 10.1.21-MariaDB Source distributionCopyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> 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 | utf8 || character_set_system | utf8 || character_sets_dir | /opt/lampp/share/charsets/ |+--------------------------+----------------------------+
成功 latinl 改为了 UTF-8
阅读全文
0 0
- centos 7.2中xampp mysql 数据字符集设置解决中文乱码
- xampp下mysql设置密码以及解决中文乱码问题
- centos修改mysql字符集 解决中文乱码问题
- CentOS(Linux)中解决MySQL中文乱码
- xampp下mysql解决中文乱码问题
- MySQL字符集设置及中文乱码
- oralce 导入数据中文乱码-设置字符集
- MYSQL字符集设置,解决乱码问题
- centos中文字符集设置
- mysql 字符集utf8设置 ,中文乱码mysql设置
- xampp下mysql linux解决中文乱码问题
- XAMPP下的MYSQL解决中文乱码问题
- jforum用到MySQL设置字符集为UTF8(Windows版)解决中文乱码
- XAMPP下mysql插入数据中文乱码问题
- Centos mysql 解决中文乱码的问题
- Mysql中解决中文乱码- -
- CentOS下设置中文编码设置和中文乱码解决
- tomcat 字符集设置 url中文乱码解决大全
- 欢迎使用CSDN-markdown编辑器
- List与Json的相互转换
- ###struts模型驱动(必须new)能够封装【对象类型属性的属性】.页面传参错误导致的问题:HTTP Status 500
- 【git相关1】一些基本命令
- 《程序设计进阶—Java语言.翁恺》第一周编程作业-分数
- centos 7.2中xampp mysql 数据字符集设置解决中文乱码
- Hbase
- 计网_C语言编程获取本机的mac地址以及mac下pcap编程报错Undefined symbols for architecture x86_64-"_pcap_*****"...的解决办法
- JAVA对象、数组转JSON
- python django开发总结
- 机器学习概述
- jsp页面 jsp与servlet url传递参数 Java web下载文件文件名乱码
- AES加解密字符串详解
- JDBC连接Oracle代码案列操作之--Oracle简单数据准备