I am trying to troubleshoot a script that I use to query a database. To make sure everything is working correctly, I split it into a simple "SHOW TABLES" query. The problem is that it returns the number of tables instead of the list of names that it should return.
import pymysql
connection = pymysql.connect(host='10.0.0.208', user='admin', passwd='Passwrd')
cursor = connection.cursor()
sqlstring = 'SHOW TABLES;'
cursor.execute('USE CustDB')
x = cursor.execute(sqlstring)
print(x)
This returns only "17". What am I missing?
source
share