92.0k views
5 votes
How do i install glastopf on a windows computer using python and MySQL?

User Jaydo
by
3.7k points

1 Answer

3 votes

Step-by-step explanation:

Connecting to MySQL using Python

Before you can access MySQL databases using Python, you must install one (or more) of the following packages in a virtual environment:

mysqlclient: This package contains the MySQLdb module. It is written in C, and is one of the most commonly used Python packages for MySQL.

mysql-connector-python: This package contains the mysql.connector module. It is written entirely in Python.

PyMySQL: This package contains the pymysql module. It is written entirely in Python.

All three of these packages use Python's portable SQL database API. This means that if you switch from one module to another, you can reuse almost all of your existing code (the code sample below demonstrates how to do this).

Setting up the Python virtual environment and installing a MySQL package

To set up the Python virtual environment and install a MySQL package, follow these steps:

Log in to your account using SSH.

To create a virtual environment, type the following commands:

User Rgov
by
4.0k points