文章分类 - pymysql
超能力是连接两个世界(mysql和python)
摘要:删除数据 import pymysql db = pymysql('localhost', 'root', '123456', 'heimdall') cursor = db.cursor() 删除数据 delete = "delete from employee where age=19" 删除失
阅读全文
摘要:更新数据 import pymysql db = pymysql('localhost', 'root', '123456', 'heimdall') cursor = db.cursor() 用于更新数据的sql语句 update = "UPDATE employee SET age = age
阅读全文
摘要:创建数据库 import pymysql db = pymysql.connect('localhost', 'root', '123456', 'heimdall') cursor = db.cursor() -判断EMPLOYEE表是否存在,存在就删除 cursor.execute('DROP
阅读全文
摘要:插入数据 import pymysql db = pymysql.connect('localhost', 'root', '123456', 'heimdall') cursor = db.cursor() sql = "INSERT INTO employee(id, name, sex)VAL
阅读全文
摘要:建立连接 import pymysql db = pymysql.connect('localhost', 'root', '123456', 'heimdall') # heimdall 是数据库名 -创建游标 cursor = db.cursor() -执行命令 cursor.execute('
阅读全文
摘要:pymysql具有连接两个世界的能力(python和mysql),就有海姆达尔的超能力连接阿斯加德和其他世界
阅读全文

浙公网安备 33010602011771号