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

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

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

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

[[email protected] ~]$ 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

时间: 2024-12-18 03:27:03

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

[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 have a default value 原因是在my.ini配置文件中有这样一条语句 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 指定了严格模式,为了安全,严格模式禁止通过insert 这种形式直接修改mysql库中的user表进行添加新用户

[mysql] 无法通过insert 创建用户ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value

[mysql]ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value 我的MySQL版本为5.6.14版本,是二进制包安装的(虽然是二进制包安装的,但是以下问题同样适用于源码安装包安装的MySQL) 今天在我的测试库上添加一个新用户,报错: [[email protected] ~]$ mysql -uroot -p123456Warning: Using a password on the command line

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

添加用户 insert into mysql.user(Host,User,Password) values("localhost","test",password("1234")); 报以下的错误 ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value错误 mysql5.1以上版本,我是在5.6版本上操作的. 错语原因: mysql用户表的中某些字段不能为空,没有默

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

使用如下语句添加用户: insert into mysql.user(Host,User,Password) values ("%","aas","Aas123456"); 错语原因: mysql用户表的中某些字段不能为空,没有默认值,其实是操作错误,mysql添加用户是不能这样直接insert user表的. 解决: create user 'aas'@'%' identified by 'Aas123456'; mysql创建用户报错ERRO

mysql ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_1d87_0.MYI'; try to repair it

[[email protected] ~]# df -h 查看是否空间不足 在查看mysql数据目录情况 mysql> show variables like '%dir%'; +-----------------------------------------+------------------------------------+ | Variable_name                           | Value                              |

MYSQL ERROR 1194 (HY000)

操作系统文件限制大小导致 MYSQL ERROR 1194 (HY000): Table is marked as crashed and should be repaired 问题处理 同事反馈应用在执行查询某张表时候报ERROR 1194 (HY000): Table is marked as crashed and should be repaired 错误 mysql> select * from ims_stat_msg_history where module='basic' and

Mac mySql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)的解决办法

我的环境:Mac 10.11.6 ,mysql  5.7.14  . mac mySql 报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 这个错是链接时报的错,要链接必须启动.修复的时候首先要启动mysql. 首先来了解一下 mysql.sock的作用: Mysql有两种连接方式: (1),TCP/IP (2),socket 对mysql.sock来说,其

mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

解决方案如下: mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory") 原文地址:https://www.cnblogs.com/youran-he/p/8182280.html

Linux中mysql进入命令行报错:MYSQL ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.99.192' (111)

场景:在Linux中安装mysql01和mysql02,通过VIP虚出一个VIP=192.168.99.192,mysql01为主ip为192.168.99.153,mysql02为备机ip为192.168.99.154 此时VIP在mysql01上通过 mysql01上连接VIP :mysql -h 192.168.99.192 -P 3306   结果是可以正常进入mysql命令行: 通过mysql02上远程连接VIP 会在界面上报错:mysql error 2003(HY000):Can'