Querying MariaDB from python

Thomas Jollans tjol at tjol.eu
Tue Oct 2 12:13:36 EDT 2018


On 2018-10-02 18:07, Tony van der Hoff wrote:
> On 02/10/18 16:47, Ervin Hegedüs wrote:
>> hi,
>>
>> now rows will looks like this:
>> ({'id':...,...},{'id':...,}...)
> 
> Thanks Ervin, but:
> 
>    cursor = cnx.cursor(pymysql.cursors.DictCursor)
> NameError: name 'pymysql' is not defined
> 
> I have been using the mysql.connector module, which seems to be the
> "official" python interface. I hadn't spotted the pymysql module. Is the
> consensus here that pymysql is the preferred connector?

I don't know, but it appears to be (the?) one that solves your problem.




More information about the Python-list mailing list