使用Python生成模拟数据(测试数据),连接数据库及服务器接口,并涉及雪花ID服务
发布时间
阅读量:
阅读量
fake = Faker('zh_CN')
url = "http://192.168.16.178:8081/v1/app/test/submit"
try:
# 创建一个数据库连接
conn = pymysql.connect(host='127.0.0.1',
port=3306,
user='root',
password='root',
database='yzpj'
)
print('连接mysql成功')
# 创建一个游标
cursor = conn.cursor()
# 创建一个sqL语句
sql = "INSERT INTO `t_tester`(`id`, `name`, `id_type`, `id_no`, `phone`, `gender`, `birthday`, `education`,`education_years`, `subjective_ses`, `famil
全部评论 (0)
还没有任何评论哟~
