The Complete Project Source Code Platform is a community of ONE million programmers and students, Just like you, Helping each other.Join them. It only takes a minute: Sign Up

Python installation and database configuration step by step

1. Download latest python 3.7 & xampp for mysql databases

Download latest version of python i.e 3.7. After successful download install it. Download python 3.7

Here you can download latest version of xampp, and then install it. Download xampp

Subscribe us on youtube

2. Install python 3.7

After successfully download python, then Click on setup files and then install it.

Instalation steps

3. Check python & pip version by commands

Use this command to check python version.

cmd > python

User this command to check pip versions.

cmd > pip --version

4. Pip not install then use this command for install.

Installing with To install pip, securely download
run this command -

curl -o
Then run the following:

5. Install PyMySQL library.

For Installing PyMySQL library.
run this command -

pip3 install PyMySQL

6. Create a file Database connection code.

create a file with below code.

    import pymysql

    conn = pymysql.connect(host='localhost', port=3306, user='root', passwd='root', db='user')

    cur = conn.cursor()
    cur.execute("SELECT * FROM user_email")


    for row in cur:


Create a database & table and insert dummy records.

You have to know basic about phpmyadmin and mysql. Firstly you have to learn how to create a database and table then run this code. open phpmyadmin for a database and tabel - localhost/phpmyadmin.
Databasename - user.
Tabelname - user_email

7. Finally run Database connection code.

Run python database connection code.that code put in c:/apy/
run this command -