import pymysql.cursors
# using PyMySQL 0.9.3
try:
    # Create connection object
    cursor = pymysql.cursors.DictCursor
    con = pymysql.connect(
        host= "localhost",
        user= "root",
        passwd= "",
        database= "my_first_db",
        charset= "utf8mb4",
        cursorclass=cursor
    )

    print(con)
        
    # Create curser object
    cur = con.cursor()

    print(cur)

    # Preparing select query
    read_query = "select * from employee"

    # Execute select query
    cur.Execute(read_query)

    # getting all rows into result
    result = cur.fetchall()

    for row in result:
        print(row)

except Exception as e:
    print(f"Error = {e}")


















































































































































































































































































































































































































































































































else:
    pass