-
Notifications
You must be signed in to change notification settings - Fork 0
/
SQL Credentials.txt
49 lines (40 loc) · 1.15 KB
/
SQL Credentials.txt
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
QA Database -
from sqlalchemy import create_engine
from sqlalchemy import text
import pandas as pd
import urllib.parse
db_username = 'ssmlqa'
db_password = 'xey[n2WnWN9nbThE'
db_host = '10.200.74.73'
db_port = '3306'
db_database = 'shyamhpz_shyamsteel'
encoded_password = urllib.parse.quote(db_password)
db_url = f"mysql+mysqlconnector://{db_username}:{encoded_password}@{db_host}:{db_port}/{db_database}"
engine = create_engine(db_url)
query = text("""
SHOW TABLES;
""")
with engine.connect() as connection:
result = connection.execute(query)
tbl_lst = list(result)
tbl_lst
DBAdmin Database -
from sqlalchemy import create_engine
from sqlalchemy import text
import pandas as pd
import urllib.parse
db_username = 'dbadmin'
db_password = 'pG%&PSO260Od'
db_host = '13.232.163.224'
db_port = '3336'
db_database = 'shyamhpz_shyamsteel'
encoded_password = urllib.parse.quote(db_password)
db_url = f"mysql+mysqlconnector://{db_username}:{encoded_password}@{db_host}:{db_port}/{db_database}"
engine = create_engine(db_url)
query = text("""
SHOW TABLES;
""")
with engine.connect() as connection:
result = connection.execute(query)
tbl_lst = list(result)
tbl_lst