当前位置:网站首页>数据库的严格模式
数据库的严格模式
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;
边栏推荐
- vscode上利用screen命令跑代码
- .NET 跨平台应用开发动手教程 |用 Uno Platform 构建一个 Kanban-style Todo App
- Debezium error series 20: task failed to create new topic. Ensure that the task is authorized to create topics
- 二叉查找树的定义,查找,插入,删除
- Axure轮播图
- 数据清洗-使用es的ingest
- PS Basic Learning (1)
- Linux 部署mysql 5.7全程跟踪 完整步骤 django部署
- Shell script if statement
- Manually set transaction commit in mysql
猜你喜欢

边缘计算与小程序也能结合!智能家居是否能借势上台阶

【LeetCode】64. 最小路径和 - Go 语言题解

Encapsulate and obtain system user information, roles and permission control

如何在WordPress网站上添加导航菜单

Unity 加载读取PPT

【LeetCode】55. 跳跃游戏 - Go 语言题解

@requestmapping注解的作用及用法

vscode上利用screen命令跑代码

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

Shell script if statement
随机推荐
How to adjust Chinese in joiplay simulator
leetcode 406. Queue Reconstruction by Height 根据身高重建队列(中等)
智能创意中的尺寸拓展模块
2022 Nioke Summer Multi-School Training Camp 1 J Serval and Essay
An easy-to-use interface testing tools - the Postman
【LeetCode】64. 最小路径和 - Go 语言题解
uni-ui安装
The performance management method OKR is used by all companies
leetcode(刷题篇13)
宽客必备神器-AKShare
Necessary artifacts - AKShare quants
Week 19 Progress (Understanding IoT Basics)
[Meng Xin problem solving] Delete the Nth node from the bottom of the linked list
测试人面试 常被问到的计算机网络题,高薪回答模板来了
joiplay模拟器不支持此游戏类型怎么解决
(WebFlux)001、如何自定义注解实现功能
image里的mode属性
uniapp折叠框二级循环
The difference between ?? and ??= and ?. and || in JS
2D转换模块&&媒体查询