I'm trying to convert a program from python 2 to python 3. The MYSQL database I setup in my program had to be updated. I've ran into a problem very similar to this one, but I don't understand how to change my object from 'connection' to 'Connection' since there's no casting in Python
Here's my code:
import _mysql as mc
db = mc.connect (host = "localhost", user = "root", passwd = "password1234")
cursor = db.cursor()
It looks correct, but for some reason the connect() function is returning a 'connection' object instead of 'Connection'. Any help is appreciated.
For mysqlclient
import MySQLdb
Do not use _mysql as it is low level interface and does not include all the methods
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With