GBase如何兼容sqlalchemy

GBase如何兼容sqlalchemy

环境

GBase版本:Gbase8s_华为鲲鹏
Python版本:2.7.16
pymysql版本:0.9.3
sqlalchemy版本:1.3.1

方法

GBase的访问采用pymysql插件,比如
import pymysql
connetction = pymysql.connect(host=‘localhost’, port=5258, user=‘xxx’, password=‘xxxxx’, db = ‘gbase’, charset=‘utf8mb4’, unix_socket=’/opt/GBase/Server/tmp/gbase.sock’);

而在sqlalchemy的链接为
sql_connection = mysql+pymysql://xxx:[email protected]:5258/xxx

你可能感兴趣的:(GBase)