-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconnection.py
More file actions
25 lines (21 loc) · 768 Bytes
/
connection.py
File metadata and controls
25 lines (21 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pymysql
def connection():
conn = pymysql.connect(host="localhost",
user="root",
passwd="Database_Password",
db="example",
use_unicode=True,
charset="utf8")
c = conn.cursor()
return c, conn
def dict_connection():
conn = pymysql.connect(host="localhost",
user="root",
passwd="Sriteja@27",
db="example",
use_unicode=True,
charset="utf8",
cursorclass=pymysql.cursors.DictCursor
)
c = conn.cursor()
return c, conn