Home >Database >Mysql Tutorial >How to enable mysql loose mode?
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 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!