Home  >  Article  >  Database  >  About removing strict mode from mysql under linux

About removing strict mode from mysql under linux

藏色散人
藏色散人forward
2020-04-09 08:59:322103browse

1. Find mysqld

$ which mysqld
/usr/sbin/mysqld

2. Find the location of my.cnf

$ /usr/sbin/mysqld --verbose --help | grep -A 1 'Default options'
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf

3. Use vim to open /etc/my.cnf

$ vim /etc/my.cnf

4. Modify the configuration , just delete STRICT_TRANS_TABLES

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

If not, just add it directly

sql_mode=NO_ENGINE_SUBSTITUTION

5. Restart mysql

$ service mysqld restart

After modification, if there are some prompts, like:

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

will not prompt.

Recommended: "mysql video tutorial"

The above is the detailed content of About removing strict mode from mysql under linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete