在python中的RDS中创建并插入了表格,它没有显示错误,但在AWS RDS中却看不到它

时间:2019-05-23 17:32:29

标签: python mysql rds

在python的aws rds中创建并插入表。它也显示输出,但未反映在RDS中。

import mysql.connector

myconn = mysql.connector.connect(host="testdb.cujdryz5rc3f.us- east-2.rds.amazonaws.com", port=3306, user="ninky", password="ninkyrds",  database="Emp_info")

cur = myconn.cursor()
query = """insert into EMP_DETAIL(name,age,salary) values (%s,%s,%s)"""
value = [("deepak", 29, 6700)]
cur.executemany(query, value)
query2="select * from EMP_DETAIL"
cur.execute(query2)
for x in cur.fetchall():
   print(x)
myconn.close()

output
--------
('deepak', 29, 6700)

如果有人对此提供帮助,那就太好了。

0 个答案:

没有答案