03 2020 档案
摘要:开启事务 当你开启事务时,你执行MySQL的增删改都不会实际上的修改,当你执行commit时你所有的操作才会生效,同理你执行rollback时便会取消你执行的操作 begin; commit; rollback; --开启事务 begin;--使事务生效commit;--使事务失效rollback;
阅读全文
摘要:commit() 在没有执行这个属性前,所有的增删改都是没有提交成功的 # 导入模块 from pymysql import * # 链接数据库 conn = connect(host = "localhost",port = 3306,user='root',password="135853",d
阅读全文
摘要:Python与MySQL的基本流程 # 导入模块 from pymysql import * # 链接数据库 conn = connect(host = "localhost",port = 3306,user='root',password="135853",database="jing_dong
阅读全文
摘要:--基本查询select * from 表名 where 判断条件; 模糊查询 select * from 表名 where name like "张%"; 查询姓张的所有数据 select * from 表名 where name like "张_"; 查询两个字姓张的 select * from
阅读全文