Python连接gbase数据库

1)安装依赖库

	pip install pymysql

2)查询代码

    import pymysql.cursors
	// 连接gbase数据库
	connection = pymysql.connect(host='127.0.01', port=5258, user='root', 
                             password='111', db='habo', charset='utf8mb4')                            
	cur = connection.cursor();
	cur.execute("SELECT * FROM dim_vip limit 10")
	for r in cur.fetchall():
    	print(r);    
	connection.close()

你可能感兴趣的:(python)