ERROR 1364: 1364: Field 'ssl_cipher' doesn't have a default value .
SQL Statement:
SQL语句:
INSERT INTO `samedaycrm4`.`users` (`Host`, `User`, `Password`) VALUES ('%', 'Bonnie', '*BB71B8925EED8E5387A872A38E566BFCB0F78071')
I am trying to determine the cause of the error ERROR 1364: 1364: Field 'ssl_cipher' doesn't have a default value..?
我正在试图确定错误错误的原因1364:1364:Field 'ssl_cipher'没有默认值..?
Thanks in advance...
提前谢谢…
3 个解决方案
#1
5
The ssl_cipher
column in your table has been marked non-null
, but your INSERT
query isn't providing a value for it. MySQL will try to assign the default value in these circumstances, but your column hasn't been given one.
表中的ssl_cipher列已被标记为非空,但是您的INSERT查询并没有提供它的值。MySQL将尝试在这些情况下分配默认值,但是您的列还没有给出。
You need either to set a default value for ssl_cipher
, or alter the table such that the ssl_cipher
is not marked as non-null
您需要为ssl_cipher设置一个默认值,或者修改表,这样ssl_cipher就不会被标记为非空值。
#2
4
//This happens due to the internal structure of user table in mysql database (mysql.user) has many column of administrative privileges which accept 'N' or 'Y' value but not NULL Value. Not assigning these values in user addition syntax by INSERT method will provide null values to table and hence error 1364 occur. //instead using GRANT syntax will give no administrative privileges to user mysql>use mysql;
/ /这是由于在mysql数据库用户表的内部结构(mysql.user)有许多列的管理权限接受“N”或“Y”值而不是NULL值。不指定这些值在用户除了语法插入方法将提供零值表,因此1364年发生错误。/ /而不是使用语法会给没有管理权限授予用户mysql >使用mysql;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE
-> ON database.* //for all tables in DATABASE database
-> TO 'user'@'localhost'
-> IDENTIFIED BY 'password';
//user will get created
/ /将会创建用户
#3
-1
FYI check comment from "Sergei Golubchik" at https://bugs.mysql.com/bug.php?id=14579
FYI在https://bugs.mysql.com/bug.php?id=14579中对“Sergei Golubchik”进行了检查。
[ It doesn't look like a bug to me. INSERT INTO mysql.user is deprecated since 3.23 - one should use GRANT or CREATE USER to add new users. As for the GRANT failing on Windows, it's a duplicate of the BUG#13989, which is "Not a bug" either. GRANT fails because on Windows, installer adds the following line to my.ini sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" which prevents GRANT from auto-creating users.]
这对我来说不像虫子。插入mysql。从3.23开始,用户就被弃用了——应该使用GRANT或者创建用户来添加新用户。至于Windows上的授权失败,它是BUG#13989的副本,也就是“不是BUG”。GRANT失败了,因为在Windows上,安装程序增加了下面一行。ini sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER, no_engine_",这阻止了自动创建用户的授权。]
And finally the implementation for CREATE USER, you can find at -
最后,创建用户的实现,你可以在-。
https://dev.mysql.com/doc/refman/5.7/en/adding-users.html
https://dev.mysql.com/doc/refman/5.7/en/adding-users.html
It should solve your problem, using "CREATE USER" approach.
它应该解决您的问题,使用“创建用户”方法。
#1
5
The ssl_cipher
column in your table has been marked non-null
, but your INSERT
query isn't providing a value for it. MySQL will try to assign the default value in these circumstances, but your column hasn't been given one.
表中的ssl_cipher列已被标记为非空,但是您的INSERT查询并没有提供它的值。MySQL将尝试在这些情况下分配默认值,但是您的列还没有给出。
You need either to set a default value for ssl_cipher
, or alter the table such that the ssl_cipher
is not marked as non-null
您需要为ssl_cipher设置一个默认值,或者修改表,这样ssl_cipher就不会被标记为非空值。
#2
4
//This happens due to the internal structure of user table in mysql database (mysql.user) has many column of administrative privileges which accept 'N' or 'Y' value but not NULL Value. Not assigning these values in user addition syntax by INSERT method will provide null values to table and hence error 1364 occur. //instead using GRANT syntax will give no administrative privileges to user mysql>use mysql;
/ /这是由于在mysql数据库用户表的内部结构(mysql.user)有许多列的管理权限接受“N”或“Y”值而不是NULL值。不指定这些值在用户除了语法插入方法将提供零值表,因此1364年发生错误。/ /而不是使用语法会给没有管理权限授予用户mysql >使用mysql;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE
-> ON database.* //for all tables in DATABASE database
-> TO 'user'@'localhost'
-> IDENTIFIED BY 'password';
//user will get created
/ /将会创建用户
#3
-1
FYI check comment from "Sergei Golubchik" at https://bugs.mysql.com/bug.php?id=14579
FYI在https://bugs.mysql.com/bug.php?id=14579中对“Sergei Golubchik”进行了检查。
[ It doesn't look like a bug to me. INSERT INTO mysql.user is deprecated since 3.23 - one should use GRANT or CREATE USER to add new users. As for the GRANT failing on Windows, it's a duplicate of the BUG#13989, which is "Not a bug" either. GRANT fails because on Windows, installer adds the following line to my.ini sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" which prevents GRANT from auto-creating users.]
这对我来说不像虫子。插入mysql。从3.23开始,用户就被弃用了——应该使用GRANT或者创建用户来添加新用户。至于Windows上的授权失败,它是BUG#13989的副本,也就是“不是BUG”。GRANT失败了,因为在Windows上,安装程序增加了下面一行。ini sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER, no_engine_",这阻止了自动创建用户的授权。]
And finally the implementation for CREATE USER, you can find at -
最后,创建用户的实现,你可以在-。
https://dev.mysql.com/doc/refman/5.7/en/adding-users.html
https://dev.mysql.com/doc/refman/5.7/en/adding-users.html
It should solve your problem, using "CREATE USER" approach.
它应该解决您的问题,使用“创建用户”方法。