MySQL防止delete命令删除数据的两种方法
时间:2024-01-13 10:18:41
方法一
我常用的做法,就是在数据库中加一个删除标识字段,
如: isdel=1 这样就代码删除的字段了
方法二
直接限制mysql删除
启动MySQL的时候加上参数 -U
-U, --safe-updates Only allow UPDATE and DELETE that uses keys.
他的作用是防止执行delete的时候没带有条件语句,如果没加上where则语句不执行。
标签:MySQL,delete,删除数据
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python利用前序和中序遍历结果重建二叉树的方法
2023-03-01 14:56:35
![](https://img.aspxhome.com/file/2023/5/75365_0s.png)
Scrapy+Selenium自动获取cookie爬取网易云音乐个人喜爱歌单
2023-06-26 10:15:54
![](https://img.aspxhome.com/file/2023/6/95376_0s.png)
一个完美网站的101项指标.第七部分.W3C标准
2008-03-01 09:31:00
VBScript中LBound函数和UBound函数的用法
2008-06-27 13:02:00
降低锁竞争 减少MySQL用户等待时间
2011-03-11 18:58:00
ASP把数字用逗号每3位隔开显示代码
2008-01-02 13:11:00
![](https://img.aspxhome.com/file/UploadPic/20081/2/200812132551808s.gif)
JavaScript中实现字符串的取左取右(实现left和right功能)
2009-07-20 12:39:00
使用Dajngo 通过代码添加xadmin用户和权限(组)
2021-08-07 17:43:59
Python实现自动化处理Word文档的方法详解
2022-05-24 00:33:59
![](https://img.aspxhome.com/file/2023/2/72782_0s.jpg)
Python 中urls.py:URL dispatcher(路由配置文件)详解
2021-01-19 02:47:15
![](https://img.aspxhome.com/file/2023/3/101193_0s.png)
python+selenium+chromedriver实现爬虫示例代码
2021-03-05 02:53:23
![](https://img.aspxhome.com/file/2023/4/118734_0s.png)
Python中字典(dict)合并的四种方法总结
2022-08-28 00:40:56
![](https://img.aspxhome.com/file/2023/1/134741_0s.jpg)
详解python中的三种命令行模块(sys.argv,argparse,click)
2021-04-24 12:57:10
Thinkphp微信公众号支付接口
2024-05-11 09:16:51
Python线性表种的单链表详解
2022-03-02 07:36:58
![](https://img.aspxhome.com/file/2023/4/90694_0s.png)
Python3.6正式版新特性预览
2023-11-02 09:27:09
基于python实现上传文件到OSS代码实例
2022-12-14 16:45:17
Python如何爬取qq音乐歌词到本地
2021-03-25 19:59:45
![](https://img.aspxhome.com/file/2023/8/97238_0s.jpg)
python如何在word中存储本地图片
2022-09-13 02:17:53
![](https://img.aspxhome.com/file/2023/3/68343_0s.png)
SQL Server 2016 CTP2.2安装配置方法图文教程
2024-01-18 19:04:29
![](https://img.aspxhome.com/file/2023/5/92735_0s.png)