# 导入模块
import pymysql
# 连接数据库
mysql_conn = pymysql.connect(host="127.0.0.1",
port=3306,
user="root",
password="",
charset="utf8",
db="t1")
# 获取游标
c = mysql_conn.cursor(cursor=pymysql.cursors.DictCursor)
# SQL语句
sql = "select * from users WHERE name='jwb' and age=73 "
# 执行SQL
res = c.execute(sql)
# 打印结果
print(c.fetchall())
# 关闭游标
c.close()
# 关闭数据库
mysql_conn.close()

最新文章

  1. fallacies of distributed computing
  2. iOS开发者账号配置进行设备调试
  3. 1019 JDBC链接数据库进行修删改查
  4. C++的ORM 开源框架
  5. poj3667【线段树】/【类似权值线段树写法】
  6. openssh
  7. bootstrap-datetimepicker在经过GC(Google Closure Compiler)压缩后无法使用的解决方案
  8. php模拟用户自动在qq空间发表文章的方法
  9. Web.config配置详解【转 】
  10. DC-DC芯片 同步和異步方式有什么區別
  11. C#基础学习第三天(.net菜鸟的成长之路-零基础到精通)
  12. java Scanner中next和nextLine()区别
  13. JavaScript之JS单线程|事件循环|事件队列|执行栈
  14. hdu4419
  15. bzoj 2844 albus就是要第一个出场 - 线性基
  16. Django框架的使用
  17. Android 之 应用未捕获异常处理
  18. RabbitMQ (十六) 消息队列的应用场景 (转)
  19. jsp简单实现统计在线人数
  20. Android开发 使用 adb logcat 显示 Android 日志

热门文章

  1. js ctrl+v实现图片粘贴
  2. Android模拟器Genymotion安装apk
  3. ELF解析(part one)
  4. 激活modelsim se 10.4 时运行patch_dll.bat不能生成TXT
  5. web info
  6. Angularjs学习笔记2_添加删除DOM元素
  7. Unity学习笔记 - Assets, Objects and Serialization
  8. CentOS环境下yum安装LAMP
  9. IOS设计模式的六大设计原则之接口隔离原则(ISP,Interface Segregation Principle)
  10. Python常见经典 python中if __name__ == '__main__': 的解析