`

Error Code: 1175. You are using safe update

阅读更多

        在使用mysql执行update的时候,如果不是用主键当where语句,会报如下错误,使用主键用于where语句中正常。

        异常内容:Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconnect.


        这是因为MySql运行在safe-updates模式下,该模式会导致非主键条件下无法执行update或者delete命令,执行命令SET SQL_SAFE_UPDATES = 0;修改下数据库模式。


        为测试命令确实成功执行,我们先看执行update命令前的数据状态。


        执行update命令,可以看出命令执行成功的状态。


        重新查询数据库值,已经成功更新。


        如果想要提高数据库安全等级,可以在恢复回原有的设置,执行命令:SET SQL_SAFE_UPDATES = 1;执行成功后,以delete命令为例,非主键情况下又报错了,说明安全等级修改成功。


 

文章来源:http://jingyan.baidu.com/article/e5c39bf58ed69239d76033a4.html

  • 大小: 3.3 KB
  • 大小: 18.5 KB
  • 大小: 7.3 KB
  • 大小: 28.5 KB
  • 大小: 7.2 KB
  • 大小: 1.7 KB
分享到:
评论

相关推荐

    ERROR CODE: 1175 YOU ARE USING SAFE UPDATE MODE AN

    You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column 进过一番搜索之后发现原来是MySQL Workbench的安全设置。当要执行的SQL语句是进行批量更新或者删除的时候...

    EurekaLog_7.5.0.0_Enterprise

    No files are copied to \bin folder of IDE. Run-time package (EurekaLogCore) is copied to Windows\System32 folder. Refer to help for more info. 2)....Added: RAD Studio 10.1 Berlin support 3)....Added:...

    BobBuilder_app

    You can switch to the SortedDictionary in the code at any time if you wish and it makes no difference to the overall code other than you can remove the sorting in the page splits. I also tried an ...

    spring-boot-reference.pdf

    24.7. Type-safe Configuration Properties 24.7.1. Third-party Configuration 24.7.2. Relaxed Binding 24.7.3. Merging Complex Types 24.7.4. Properties Conversion Converting durations 24.7.5. @...

    Sakemail

    If you are strongly opossed to this change, drop me a line and tell me why (I‘m in doubts).1.8.5- Greg Nixon added the priority property. The default priority for each msg created will be prNormal, ...

    spring-framework-reference4.1.4

    Not Using Commons Logging ................................................................... 12 Using SLF4J ..............................................................................................

    spring-framework-reference-4.1.2

    Not Using Commons Logging ................................................................... 12 Using SLF4J ..............................................................................................

    VclZip pro v3.10.1

    - property isZip64 - tells you when you are working with a zip file that is using Zip64 format. Much faster processing due to linking to Zlib object files for compression and decompression routines. ...

    polycom宝利通视频会议软件3.9 2018

    Further, no license is granted to you in the human readable code of the SOFTWARE PRODUCT (source code). Except as expressly provided below, this License Agreement does not grant you any rights to ...

    uhdd.sys源码

    code in HMA space with its H switch taking only 832 bytes 640 "stand alone" UDVD2 handles up to 6 SATA IDE or old PIO mode CD DVD drives it tests up to 10 controllers on loading and takes...

Global site tag (gtag.js) - Google Analytics