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. 移动web开发(四)——X-UA-Compatible

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> IE=edge告诉 ...

  2. IE11 不能正常方法网页

    由于将IE11升级到了 11 之前的网站无法正常使用, 如果是开发人员碰到之问题,使用了微软的asp.net 控件,那么将服务器的.net framework 升级到 4.5 http://www.m ...

  3. css优化建议

    1.不要使用过小的图片做背景平铺.这就是为何很多人都不用 1px 的原因,这才知晓.宽高 1px 的图片平铺出一个宽高 200px 的区域,需要 200*200=40, 000 次,占用资源. 2.无 ...

  4. InstallShield卸载状态

    uninstallaing() 它对应于-unistall 命令,在installshield 2009及之前的版本,在控制面板中选择"uninstall”会触发这个命令.但在install ...

  5. CAS (12) —— CAS TicketRegistry使用JPA方案数据源c3p0与JNDI

    CAS (12) -- CAS TicketRegistry使用JPA方案数据源c3p0与JNDI tomcat版本: tomcat-8.0.29 jdk版本: jdk1.8.0_65 cas版本: ...

  6. 【进阶修炼】——改善C#程序质量(4)

    46, 显示释放资源,需要实现IDisposable接口. 最好按照微软建议的Dispose模式实现.实现了IDisposable接口后,在Using代码块中,垃圾会得到自动清理. 47, 即使提供了 ...

  7. windows 7 下安装 vagrant + Oracle VM VirtualBox

    一.安装下准备 1.下载Oracle VM VirtualBox https://www.virtualbox.org/wiki/Downloads  (VirtualBox-4.3.22-98236 ...

  8. oozie 运行demo

    昨晚装好了oozie,能启动了,并且配置了mysql作为数据库,好了,今天要执行oozie自带的demo了,好家伙,一执行就报错!报错很多,就不一一列举了,就说我最后解决的方法吧. oozie job ...

  9. 移动端报表JS开发演示样例

    近期对移动端的报表开发颇有研究,细磨精算了好久,尽管到如今还是"囊中羞涩",但决定还是先抛砖引玉,拿点小干货出来和大家分享. 研究的工具是比較有代表性的FineReport. 1. ...

  10. Spring Boot war包&jar包对比

    使用 Maven对SpringBoot程序进行打包处理有两种格式:一种是war包,一种是jar包. 虽然我们将springboot应用打包成了war包,但是我们依然可以使用 java -jar的方式来 ...