<jupyter_start><jupyter_text>Model Experimentation Tracking (MLFow)<jupyter_code>#for connecting with local 

import urllib.parse
from sqlalchemy import create_engine
connectString = 'Driver={ODBC Driver 17 for SQL Server};Server=IMCLBCP151-MSL1\SQLEXPRESS;uid=sa;pwd=<PASSWORD>;Database=env_mlflow;Trusted_Connection=yes'
url = urllib.parse.quote(connectString)
print(url)
engine = create_engine("mssql+pyodbc:///?odbc_connect=" + url)
engine.execute('select * from runs').fetchall()
!pip3 install pymysql
import pymysql

Server = 'testmlflowrds.caomvyotl9eq.us-east-2.rds.amazonaws.com'
Port = int(3306)
Database = 'testmlflow'
Username = 'admin'
Password = '<PASSWORD>'


db = pymysql.connect(host=Server, port=Port,
               user='admin', password='<PASSWORD>', database=Database)
cursor = db.cursor()
cursor.execute("select version()")
data = cursor.fetchall()
data
sql = '''select * from runs where 1 2 '''
cursor.execute(sql)
cursor.fetchall()
# Server = 'mlflow-db.caomvyotl9eq.us-east-2.rds.amazonaws.com'
# Port = '3306'
# Database = 'mlfowdb'
# Username = 'admin'
# Password = '<PASSWORD>'
# --backend-store-uri mysql+pymysql://${USERNAME}:${PASSWORD}@${HOST}:${PORT}/${DATABASE}

import pymysql

import pandas as a

conn=pymysql.connect(
    host='mlflow-db.caomvyotl9eq.us-east-2.rds.amazonaws.com',
    port=int(3306),
    user='admin',
    passwd='<PASSWORD>',
    db='mlfowdb',
    charset='utf8mb4')

df=a.read_sql_query("SELECT * FROM runs ",conn)

print(df)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15518351577591757, 'fraction_numerical': 0.018673535093367676, 'mean_word_length': 4.931297709923665, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '296209', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 604, 'n_tokens_neox': 583, 'n_words': 96, 'path': 'notebooks/connecting to local and RDS DB.ipynb', 'repo_name': 'kalpesh94552/los_model_production_repo', 'size': '1547'}