当前位置:网站首页>数据库的严格模式
数据库的严格模式
2022-07-31 00:00:00 【Miracle_ze】
数据库的严格模式
严格模式
1.介绍
mysql数据库存在严格模式,或许会有给了默认值的字段在sql插入的时候必须得赋值,否则报错。
5.7版本默认严格模式,insert插入用户表的方式创建新用户不行为此需要调整
2.使用配置文件对严格模式管理开启与关闭【开启了mysql服务】
1.查看严格模式是否开启
1.linux【my.cnf文件】
vim /etc/my.cnf
严格模式:
sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
搜索 sql-mode 如果搜索不到上条内容就代表 非严格模式
2.windows为my.ini
严格模式:sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
在文件中搜索 sql-mode 如果搜索不到上条内容就代表 非严格模式
2.关闭严格模式【my.cnf文件】,要开启删除语句
搜索sql-mode关键字,若没有,在文件尾添加一行
替换成:sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIO
3.重启服务
重启mysql
service mysql restart
4.进入mysql刷新权限表
flush privileges;
边栏推荐
猜你喜欢

Linux 部署mysql 5.7全程跟踪 完整步骤 django部署

实验7(MPLS实验)

How to solve types joiplay simulator does not support this game

uniapp折叠框二级循环

360核心安全大脑3.0正式发布,构建政企用户的“能力中枢平台”

.NET Cross-Platform Application Development Hands-on Tutorial | Build a Kanban-style Todo App with Uno Platform

机器学习1一回归模型(二)

How to use joiplay emulator

HCIP Day 15 Notes

Mysql体系化之JOIN运算实例分析
随机推荐
MPI简谈
"Wei cup" school more than 2022 cattle summer camp 4 Nancy (polocy) pelosi article variance law of Arts
实验7(MPLS实验)
Learn Scope from a Compilation Perspective!
宽客必备神器-AKShare
ABC 261 F - Sorting Color Balls(逆序对)
Point Cloud Scene Reconstruction with Depth Estimation
乌克兰外交部:乌已完成恢复粮食安全出口的必要准备
[Meng Xin problem solving] Delete the Nth node from the bottom of the linked list
Android安全性优化——APP加固
Lambda表达式
动态修改el-tab-pane 的label(整理)
What are the efficient open source artifacts of VSCode
Reverse linked list - head insertion inversion method
An easy-to-use interface testing tools - the Postman
Shell script if statement
joiplay模拟器报错如何解决
VSCode高效开源神器有哪些
Soft Exam Summary
firewalld