Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connecting to MySQL
#1
Hey,

Just wondering what the best way to connect and query an external MySQL database is.

I have found a few different options, some of which look very outdated.

Thanks.
Reply
#2
MySQL Connector seems like a good choice to me, but there are others too. The only one I found to be considered outdated is MySQLdb, but even this one has some forks which get some attention.

I would assume you are tied to MySQL, but if you have a chance I suggest considering Postgres too.
Reply
#3
SQLAlchemy's MySQL support lists several drivers that work, including which haven't had any development in a while, and which ones only work on python 2.x vs 3.x.
Reply
#4
(Oct-04-2016, 06:18 PM)nilamo Wrote: SQLAlchemy's MySQL support lists several drivers that work, including which haven't had any development in a while, and which ones only work on python 2.x vs 3.x.
I see PyMysql on list,but not link to GitHub it's a pure-Python MySQL client library.
If use Framework there are usually own connection made for this eg Flask-MySQLdb’s,  Flask-MySQL
Reply
#5
Thank-you everyone. I have gone with PyMySQL as it's compatible with the ARM processor in my Pi3 and seems to be maintained unlike some of the other options.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mysql and mysql.connector error lostintime 2 667 Oct-03-2023, 10:25 PM
Last Post: lostintime
  Mysql error message: Lost connection to MySQL server during query tomtom 6 15,999 Feb-09-2022, 09:55 AM
Last Post: ibreeden
  Need Help with connecting to mysql from txt file kingceasarr 4 3,302 Mar-24-2021, 05:42 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020