I'm trying to query a public sql server from within a python script.
The equivalent terminal command is :
mysql --user=genome -N --host=genome-mysql.cse.ucsc.edu -A -D hg19 -e "select name,name2 from refGene"
On the python script i'm trying to mimic this command with the following code:
import mysql.connector db = mysql.connector.connect(host="genome-mysql.cse.ucsc.edu", user="genome", database="hg19") cursor = db.cursor() data = cursor.execute("select name,name2 from refGene")
Problem is I get that
data = None
I'm quite convinced it has to do something with the flags I have left out and I don't know how I can pass these flags - couldn't find any answer to that.