Home > Database > Mysql Tutorial > How to enable mysql loose mode?

How to enable mysql loose mode?

青灯夜游
Release: 2020-09-02 11:58:34
Original
2604 people have browsed it

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

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

on linux

vi /usr/local/etc/my.cnf
Copy after login

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

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!

Related labels:
source:php.cn
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