lixiaolong 发表于 2018-8-15 10:46:24

MySQL Connector/Python 安装、测试

# python  
Python 2.7.3 (default, Jul 18 2013, 20:53:58)
  
on linux2
  
Type "help", "copyright", "credits" or "license" for more information.
  
>>> import mysql.connector
  
>>> cnx = mysql.connector.connect(user=\'waterbin\',password=\'123\',host=\'192.168.1.115\',database=\'test\')
  
>>> cur=cnx.cursor()
  
>>> cur.execute(\'select * from t\')
  
>>> print cur.fetchall()
  
[(1,)]
页: [1]
查看完整版本: MySQL Connector/Python 安装、测试