当前位置:网站首页>Strict Mode for Databases
Strict Mode for Databases
2022-07-31 00:15:00 【Miracle_ze】
Strict mode for databases
Strict Mode
1. Introduction
The mysql database has strict mode, and there may be fields with default values that must be assigned values when sql is inserted, otherwise an error will be reported.
Version 5.7 defaults to strict mode, the way to insert into the user table to create a new user cannot be adjusted
2. Use the configuration file to enable and disable strict mode management [mysql service enabled]
1. Check if strict mode is enabled
1.linux [my.cnf file]
vim /etc/my.cnf
Strict mode:
sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Search for sql-mode If you can't find the previous content, it means non-strict mode
2.windows is my.ini
Strict mode: sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Search for sql-mode in the file if you can't find the previous content, it means non-strict mode
2. Turn off strict mode [my.cnf file], to enable delete statement
Search for the sql-mode keyword, if not, add a line at the end of the file
Replace with: sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIO
3. Restart the service
Restart mysql
service mysql restart
4. Enter mysql to refresh the permission table
flush privileges;
边栏推荐
猜你喜欢
随机推荐
joiplay模拟器如何使用
47. 【Pointers and Arrays】
从两个易错的笔试题深入理解自增运算符
How to install joiplay emulator rtp
Mysql体系化之JOIN运算实例分析
[In-depth and easy-to-follow FPGA learning 15---------- Timing analysis basics]
jira是什么
常用的正则表达式
WebServer流程讲解(注册模块)
借助深度估计的点云场景重建
【深入浅出玩转FPGA学习13-----------测试用例设计1】
joiplay模拟器如何导入游戏存档
uniapp develops WeChat applet - soft exam brushing applet
mysql 中手动设置事务提交
firewalld
C# VSCode & Rider引用命名空间快捷键
Optimization of aggregate mentioned at DATA AI Summit 2022
How to solve the error of joiplay simulator
Oracle一个诡异的临时表空间不足的问题
天空云变化案例