The method of opening lax mode in mysql
This article will explain in detail how to open the loose mode of mysql. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
The way for mysql to turn on loose mode is to add "sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" under the [mysqld] module of mysql's configuration file my.cnf.
How to turn on loose mode in mysql:
Open non-strict mode in mysql
Add under the [mysqld] module of the configuration file my.cnf of mysql
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
If you want to insert the int field into string, you can use the last one, NO_ENGINE_SUBSTITUTION.
Location of the mysql configuration file
On the linux
Vi / etc/mysql/mysql.conf.d/mysqld.cnfmysql.server start
On mac.
Vi / usr/local/etc/my.cnf
The configuration files on mac are not as complete as those in linux, but let's just configure them directly, because the order in which they are executed is
The system will look for my.cnf in this order, and the following three files only find / usr/local/etc/my.cnf
This is the end of etc/my.cnf/etc/mysql/my.cnf/usr/local/etc/my.cnf~/.my.cnf 's method of opening loose mode in mysql. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.