202106-12 Python基础之操作MySQL数据库 一、数据库操作1.1安装PyMySQLpipinstallPyMySQL1.2连接数据库python连接test数据库importpymysqlhost='localhost'#主机地址username='root'#数据库用户名password=''#数据库密码db_name='test'#数据库名称#创建connect对象connect=pymysql.connect(host=host,user=username,password=password,database=db_name)#获取游标对象cursor=connect.cursor()#查询数据库版本... 继续阅读 >