Create user Error Error 1364 (HY000): Field ' ssl_cipher ' doesn ' t have a default value

Source: Internet
Author: User
Tags mysql create mysql create user

Today for the first time to play MySQL, in the default database MySQL create user times error:

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


mysql> use MySQL;
Reading table information for completion of table and column names
You can turn off the feature to get a quicker startup with-a

Database changed
Mysql> SELECT Host, user, password from user where user = ' guest ';
Empty Set (0.23 sec)

Mysql> INSERT into user
-> (host, user, password,
-> Select_priv, Insert_priv, Update_priv)
-> VALUES (' localhost ', ' scofy ',
-> PASSWORD (' MySQL '), ' y ', ' y ', ' y ');
ERROR 1364 (HY000): Field ' ssl_cipher ' doesn ' t have a default value


Reason: There is a statement in my profile my.cnf

Sql_mode=no_engine_substitution,strict_trans_tables

Strict mode is specified, in order to be secure, strict mode prohibits directly modifying the user table in the MySQL library to add new users in this form of insert



Solution:

Delete the strict_trans_tables in the configuration file to read:

Sql_mode=no_engine_substitution

and restart MySQL.


mysql> use MySQL;
Reading table information for completion of table and column names
You can turn off the feature to get a quicker startup with-a


Database changed
Mysql> INSERT into user
-> (host, user, password,
-> Select_priv, Insert_priv, Update_priv)
-> VALUES (' localhost ', ' scofy ',
-> PASSWORD (' MySQL '), ' y ', ' y ', ' y ');
Query OK, 1 row affected, 3 warnings (0.00 sec)


Mysql> SELECT Host, user, password from user where user = ' scofy ';
+-----------+-------+-------------------------------------------+
| Host | user | password |
+-----------+-------+-------------------------------------------+
| localhost | Scofy | *e74858db86eba20bc33d0aecae8a8108c56b17fa |
+-----------+-------+-------------------------------------------+
1 row in Set (0.01 sec)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.