这里有什么问题?任何指针
f=mysql.connector.connect(user='root',password='password',host='10.XX.XX.XX.XX',database='branchQA')
>>> f
<mysql.connector.connection.MySQLConnection object at 0x02CB6A30>
>>> c=f.cursor()
>>> c
<mysql.connector.cursor.MySQLCursor object at 0x02CB6E50>
>>> k=c.execute("show databases")
>>> k
>>> print k
File "<stdin>", line 1
print k
^
SyntaxError: Missing parentheses in call to 'print'
>>> print(k)
None
>>> print(k)
我执行了它显示的相同查询:
INFORMATION_SCHEMA
mysql
测试
branchQA
答案 0 :(得分:0)
执行后的Fetchall或fetchone可以解决问题。
>>> c.execute
>>>k = c.fetchall()
>>>k