From: http://m.blog.csdn.net/blog/langkeziju/13511411

我的MySQL版本为5.6.14版本,是二进制包安装的(虽然是二进制包安装的,但是以下问题同样适用于源码安装包安装的MySQL)

今天在我的测试库上添加一个新用户,报错:

[mysql@ydrh2 ~]$ mysql -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.14-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2013, 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> insert into user(host,user,password) values("localhost","peter1",password("123456"));
ERROR 1046 (3D000): No database selected
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> insert into user(host,user,password) values("localhost","peter1",password("123456"));
ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value

原因:在我的配置文件my.cnf中有这样一条语句

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

指定了严格模式,为了安全,严格模式禁止通过insert 这种形式直接修改mysql库中的user表进行添加新用户

解决办法:

将配置文件中的STRICT_TRANS_TABLES删掉,即改为:

sql_mode=NO_ENGINE_SUBSTITUTION

然后重启mysql即可

 

[mysql]ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value的更多相关文章

  1. [mysql]ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value 解决方法

    在MySQL数据库中的mysql.user表中使用insert语句添加新用户时,可能会出现以下错误: ERROR 1364 (HY000): Field 'ssl_cipher' doesn't ha ...

  2. [mysql]ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value

    转载自:http://www.cnblogs.com/joeblackzqq/p/4526589.html From: http://m.blog.csdn.net/blog/langkeziju/1 ...

  3. mysql 5.7 创建用户报错ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value

    如: INSERT INTO user (host, user, authentication_string, select_priv, insert_priv, update_priv) VALUE ...

  4. MySQL添加用户错误:ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value解决方法

    MySQL添加新用户时出现如下报错,如下图: 经过查资料了解到: mysql用户表的中某些字段不能为空,没有默认值,其实是操作错误,mysql添加用户是不能这样直接insert user表的. 改为以 ...

  5. Linux MySQl 5.7.17 MySQL ERROR 1366(HY000):Incorrect string value 解决方法

    MySQL ERROR 1366(HY000):Incorrect string value,在往数据库中插入中文的时候会出现. 这也就是编码问题,网上大部分都是说设置下配置文件中的设置,而可悲的是在 ...

  6. MySQL:ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

    解决方法: 修改密码:alter user 'root'@'localhost' identified by '123456'; mysql> use mysql; ERROR 1820 (HY ...

  7. mysql - ERROR 1114 (HY000): The table is full

    mysql - ERROR 1114 (HY000): The table is full - Stack Overflowhttps://stackoverflow.com/questions/73 ...

  8. [MySQL-1] mysql error 1101 blob/text column can't have a default value

    在MySQL Query Browser上创建一个含有TEXT类型的字段,创建不成功,报错:mysql error 1101 blob/text column can't have a default ...

  9. MySQL ERROR 1366(HY000) Incorrect string value

    有以下两张表: mysql> show tables; +---------------+ | Tables_in_old | +---------------+ | book | | pres ...

随机推荐

  1. Chrome中使用flash引起cpu飙升问题的处理

    本人使用的是Chrome 30 flash 18,在看视频或者登陆有调用flash插件的页面之后,经常会遇到Shockwave Flash插件CPU占用超过50%的情况(在Chrome的任务管理器可以 ...

  2. flash object实现视频播放效果

    html: <!--视频缩略图开始-->       <div class="fresh-media fresh-type-video">          ...

  3. 怎样把任意exe程序注册成windows系统服务(手动注册服务)

    1. 要实现这个功能要用到微软提供的两个小工具“instsrv.exe”和“srvany.exe”(下载地址:http://www.cr173.com/soft/64394.html). 先下载这两个 ...

  4. Python3玩转单链表——逆转单向链表pythonic版

    [本文出自天外归云的博客园] 链表是由节点构成的,一个指针代表一个方向,如果一个构成链表的节点都只包含一个指针,那么这个链表就是单向链表. 单向链表中的节点不光有代表方向的指针变量,也有值变量.所以我 ...

  5. 基于jQuery环形图标菜单旋转切换特效

    分享一款基于jQuery环形图标旋转切换特效.这是一款鼠标点击图标菜单圆形顺时针或者逆时针旋转切换代码.效果图如下: 在线预览   源码下载 实现的代码. js代码: /* 图片地址可以是相对路径或绝 ...

  6. Extjs gridpanel 合并单元格

    /* * *合并单元格的函数,合并表格内所有连续的具有相同值的单元格.调用方法示例: * *store.on("load",function(){gridSpan(grid,&qu ...

  7. Python3 ctypes简单使用

    >>> from ctypes import * >>> c_int() c_long(0) >>> c_char_p(b'hello') c_c ...

  8. C语言 · 递归求二项式系数值

    算法训练 6-1 递归求二项式系数值   时间限制:10.0s   内存限制:256.0MB      问题描述 样例输入 一个满足题目要求的输入范例.3 10 样例输出 与上面的样例输入对应的输出. ...

  9. Java并发编程:阻塞队列 <转>

    在前面几篇文章中,我们讨论了同步容器(Hashtable.Vector),也讨论了并发容器(ConcurrentHashMap.CopyOnWriteArrayList),这些工具都为我们编写多线程程 ...

  10. Linux下用文件IO的方式操作GPIO(/sys/class/gpio)

    通过sysfs方式控制GPIO,先访问/sys/class/gpio目录,向export文件写入GPIO编号,使得该GPIO的操作接口从内核空间暴露到用户空间,GPIO的操作接口包括direction ...