ERROR 1364: 1364: Field 'ssl_cipher' does not have a default value

ERROR 1364: 1364: Field 'ssl_cipher' doesn't have a default value . 

SQL statement:

 INSERT INTO `samedaycrm4`.`users` (`Host`, `User`, `Password`) VALUES ('%', 'Bonnie', '*BB71B8925EED8E5387A872A38E566BFCB0F78071') 

I am trying to determine the cause of the error ERROR 1364: 1364: The 'ssl_cipher' field does not have a default value.?

Thanks in advance...

+4
source share
3 answers

The ssl_cipher column in your table has been marked non-null , but your INSERT query does not provide a value for it. MySQL will try to assign a default value in these circumstances, but your column did not receive it.

You need to either set the default value for ssl_cipher , or change the table so that ssl_cipher not marked non-null

+5
source

// This is due to the internal structure of the user table in the mysql database (mysql.user) has many administrative privilege columns that accept a value of "N" or "Y", but not a NULL value. Without assigning these values ​​in the syntax for adding users using the INSERT method, they will provide null values ​​in the table and, therefore, error 1364 will occur. // instead of using the syntax, GRANT will not give administrative privileges to the user mysql> use 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 be created

+3
source

FYI comment from "Sergey Golubchik" at https://bugs.mysql.com/bug.php?id=14579

[This is not like a mistake. INSERT INTO mysql.user has been deprecated since 3.23 - use GRANT or CREATE USER to add new users. Regarding the GRANT error in Windows, this is a duplicate of BUG # 13989, which is also "Not a bug." GRANT does not work because on Windows the installer adds the following line to my.ini SQL mode = "STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION" which prevents the creation of automatic users.]

And finally, the CREATE USER implementation, you can find on the page

https://dev.mysql.com/doc/refman/5.7/en/adding-users.html

It should solve your problem using the "CREATE USER" approach.

-one
source

Source: https://habr.com/ru/post/1499725/


All Articles