首先这个是编码的问题

--细致的分割------------------------------------------------------------------------------------------------------------------------------------------------------------------------

我要强调一下,这个问题的解决办法和mysql的版本有关,之前用的ubuntu kylin 14.04,mysql版本好像是5.5,现在用的是ubuntu kylin16.04现在mysql版本是 5.7.12-0ubuntu1 (Ubuntu),两次解决这个问题,两次都看的是同一个教程。但是实际操作过程还是不一样的。在此就记录一下在5.7.12-0ubuntu1 (Ubuntu)中的操作过程

1.show variables like '%character%',查看当前编码,因为我已经改了一次了现在系统中只有character_set_server 是latin1,如果你是刚刚有安装的mysql,那么可能有两个variable_name是latin1

2. sudo gedit /etc/mysql/my.cnf
3. 按照教程上说的这里应该有

[client]

[mysql]

[mysqld]

但是这个文件没有,此时去找找这个includedir,然后

找到这两个文件

在conf.d目录下面,用sudo gedit mysql.cnf

文件里面只有一个

[mysql]

那么就在

[mysql]下面加入 default-character-set=utf8

在mysql.conf.d文件中找到[mysqld]

下面加入character-set-server=utf8

此时已经ok了,因为mysql中character_set_client已经是utf8

然后重启电脑,就ok了

在测试

ps,文章的地一个截图是在没有重启的时候截的

参考教程 :http://blog.csdn.net/crave_shy/article/details/23345869

20160701

今天在低版本的mysql中发现如果改了配置文件就要手动的重启mysql

所以现在记录现在重启的命令

启动mysql服务:sudo start mysql 或者 sudo service mysql start
停止mysql服务:sudo stop mysql 或者 sudo service mysql stop
重启mysql服务: sudo restart mysql 或者 sudo service mysql restart

查看mysql数据库的版本号:mysql -V

启动mysqld服务: sudo /etc/init.d/mysql start
停止mysqld服务: sudo /etc/init.d/mysql stop
启动mysqld服务: sudo /etc/init.d/mysql restart

mysql 设置编码 Incorrect string value: '\xE9\x98\xBF\xE4\xB8\x89...' for column 'cont,mysql乱码的更多相关文章

  1. Mysql向新建表中插入数据, Incorrect string value: '\xE5\xBC\xA0\xE4\xB8\x89' for column 'UserName' at row 1

    在本地通过MYSQL创建测试表 CREATE Table User ( UserId int not NULL PRIMARY KEY auto_increment, //主键自增 UserName ...

  2. 1366 - Incorrect string value:'\xE5\xBC\xA0\xE4\xB8\x89' for column 'name' a 错误修改

    把name的字符集修改成 utf8 ,然后把表关了从新打开,就可以了 如果还不行,就从新创表,在创表的时候修改name的字符集 如果还不行,就修改my.ini 它在你的mysql安装路径里 [mysq ...

  3. SQL语句报错:Incorrect string value: '\xE9\x98\xBF\xE6\x96\xAF...'

    很明显是编码的问题.检查了一下$conn->query("set names utf8");已经加在代码里了.那莫非是数据库编码不是utf8? 看了一下 还真不是 于是右键要 ...

  4. MYSQL不能显示中文字,显示错误“ERROR 1366 (HY000): Incorrect string value: '\xE5\xBC\xA0\xE4\xB8\x89'”

    或者建表时带上编码utf8 CREATE TABLE `students`( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` VARCHAR( ...

  5. ERROR 1366 (HY000): Incorrect string value: '\xE9\x83\x91\xE5\xB7\x9E' for column 'aa' at row 1 MySQL 字符集

    ERROR 1366 (HY000): Incorrect string value: '\xE9\x83\x91\xE5\xB7\x9E' for column 'aa' at row 1创建表之后 ...

  6. MySQL (1366, "Incorrect string value: '\\xF0\\x9F\\x8E\\xAC\\xE5\\x89...' for column 'description' at row 1")

    (1366, "Incorrect string value: '\\xF0\\x9F\\x8E\\xAC\\xE5\\x89...' for column 'description' at ...

  7. Incorrect string value: '\xE7\x8E\x8B\xE4\xBD\xB3' for column 'contact' at row 1

    1 queries executed, 0 success, 1 errors, 0 warnings 查询:INSERT INTO beijing(contact,tel_phone,qq,comp ...

  8. ABP 切换mysql 数据库报错mysqlexception: incorrect string value: ‘\xe7\xae\x80\xe4\xbd\x93…’ for column display name

    刚折腾了ABP框架,为了跨平台,将SQL Server数据库换成了MySQL数据库,ABP框架上支持多语言,中间被字符集折腾的够呛,翻了N个博客,最后终于在StackOverFlow 上找到了最终的解 ...

  9. mysql进阶(二十二)MySQL错误之Incorrect string value: '\xE7\x81\xAB\xE7\x8B\x90...中文字符输入错误

    MySQL错误之Incorrect string value: '\xE7\x81\xAB\xE7\x8B\x90...' for column 'tout' at row 1中文字符输入错误 在实验 ...

随机推荐

  1. Linux搭建python环境中cx_Oracle模块安装遇到的问题与解决方法

    安装或使用cx_Oracle时,需要用到Oracel的链接库,如libclntsh.so.11.1,否则会有各种各样的错误信息. 安装Oracle Instant Client就可得到这个链接库,避免 ...

  2. 使用PDO进行sql的预处理和操作结果集

  3. mysqli_stmt预处理类的使用

  4. transition的局限

    transition的优点在于简单易用,但是它有几个很大的局限. (1)transition需要事件触发,所以没法在网页加载时自动发生. (2)transition是一次性的,不能重复发生,除非一再触 ...

  5. D - Palindrome Partitioning (DP)

    Description A palindrome partition is the partitioning of a string such that each separate substring ...

  6. 使用c#创建php可以调用的dll

    1. 创建一个 C# Class Library ,命名为:ClassLibraryDemo 2. 打开项目的属性,在点选左边的 “Application”(就是第一个tab) , 然后点击 Asse ...

  7. Android 判断现在系统存储器是“手机存储”还是“SD存储”

    import android.os.storage.StorageManager; String fileDir = null;            StorageManager storageMa ...

  8. Qt——树的搜索

    一.Qt中的树 Qt中树的实现有两种方式.第一种是使用Qt提供的QTreeWidget,很多函数都封装好,比较方便:另一种是通过QTreeView实现,设置它的数据模型,比如使用QStandardIt ...

  9. ios 定位 监听是否跨入某个指定的区域

    /*****监听用户是否进入和走出 在某个区域*****/ 1 #import "ViewController.h" #import <CoreLocation/CoreLo ...

  10. windows命令行

    [drive:] Change the current driver, without changing its current directory cd [drive:] [path] Just c ...