Search⌘ K
AI Features

MySQL

Explore how to connect Python 3 applications to MySQL databases by using popular packages such as mysqlclient and mysql-connector-python. Understand the history of MySQLdb, challenges with Python 3 compatibility, and gain practical experience with establishing database connections, executing SQL queries, and handling results.

We'll cover the following...

History

MySQL is a very popular open source database backend. We can connect to it with Python in several different ways. For example, we could connect to it using one of the ODBC methods we mentioned in the previous lessons. One of the most popular ways to connect to MySQL with Python is the MySQLdb package. There are actually a couple of variants of this package:

  • MySQLdb1
  • MySQLdb2
  • moist

The first is the traditional way to connect to MySQL with Python. However, its development is just now in maintenance and won’t ...