当前位置:网站首页>数据库的严格模式
数据库的严格模式
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;
边栏推荐
猜你喜欢

Kotlin特殊类

Shell programming conditional statement test command Integer value, string comparison Logical test File test

天空云变化案例

2D转换模块&&媒体查询

Encapsulate and obtain system user information, roles and permission control

测试人面试 常被问到的计算机网络题,高薪回答模板来了

How to use joiplay emulator

HCIP第十五天笔记

Bugku sql注入

transition过渡&&animation动画
随机推荐
leetcode 406. Queue Reconstruction by Height 根据身高重建队列(中等)
360核心安全大脑3.0正式发布,构建政企用户的“能力中枢平台”
transition transition && animation animation
2D Transform Module && Media Queries
Soft Exam Study Plan
如何在WordPress网站上添加导航菜单
46.<list链表的举列>
怎么开通代付通道接口?
47. 【Pointers and Arrays】
joiplay模拟器如何导入游戏存档
[动态规划] 0-1背包问题和完全背包问题
【LeetCode】42. 接雨水 - Go 语言题解
flex布局父项常见属性flex-wrap
46.
2021GDCPC Guangdong University Student Programming Competition H.History
C# VSCode & Rider引用命名空间快捷键
An easy-to-use interface testing tools - the Postman
MySQL的一个问题
【LeetCode】55. 跳跃游戏 - Go 语言题解
2022 Nioke Summer Multi-School Training Camp 1 J Serval and Essay