Home > Database > Mysql Tutorial > body text

About removing strict mode from mysql under linux

藏色散人
Release: 2020-04-09 08:59:43
forward
1896 people have browsed it

1. Find mysqld

$ which mysqld
/usr/sbin/mysqld
Copy after login

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
Copy after login

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

$ vim /etc/my.cnf
Copy after login

4. Modify the configuration , just delete STRICT_TRANS_TABLES

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
Copy after login

If not, just add it directly

sql_mode=NO_ENGINE_SUBSTITUTION
Copy after login

5. Restart mysql

$ service mysqld restart
Copy after login

After modification, if there are some prompts, like:

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

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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!