mysql.connect-查询前5条记录
时间:2021-07-01 10:21:17
帮助过:26人阅读
= mysql.connector.Connect(
host=‘localhost‘,
user=‘root‘,
passwd=‘admin‘,
database=‘testcode‘
)
print(
‘1.‘,conn)
cmd = conn.
cursor() # 光标行
cmd=conn.
cursor()
cmd.execute(
‘select * from test‘)
print(
‘5.‘,cmd.fetchmany(
5))
mysql.connect-查询前5条记录
标签:host color 记录 passwd connect cal import int print