Home  >  Article  >  Database  >  How to enable mysql loose mode?

How to enable mysql loose mode?

青灯夜游
青灯夜游Original
2020-09-02 11:56:512560browse

How to enable: Add the command "sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"" under the [mysqld] module of the mysql configuration file my.cnf.

How to enable mysql loose mode?

How to enable non-strict mode in mysql:

Enable non-strict mode in mysql

Add

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"  
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

under the [mysqld] module of mysql configuration file my.cnf. If you want to insert string into the int field, you can use the last one. NO_ENGINE_SUBSTITUTION

Mysql configuration file location

vi  /etc/mysql/mysql.conf.d/mysqld.cnf
mysql.server start

on linux

vi /usr/local/etc/my.cnf

The configuration file on mac is not as complete as in linux, but we Just configure it directly, because its execution order is

The system will find my.cnf in this order. The following three files only found /usr/local/etc/my.cnf

/etc/my.cnf
/etc/mysql/my.cnf
/usr/local/etc/my.cnf
~/.my.cnf

Related recommendations: "mysql tutorial"

The above is the detailed content of How to enable mysql loose mode?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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