<jupyter_start><jupyter_text>Workshop 1Your very first notebookConnecting to  mySQL  --- Installing pymysql<jupyter_code>!pip install pymysql<jupyter_output>Requirement already satisfied: pymysql in /opt/conda/lib/python3.8/site-packages (0.10.1)<jupyter_text>--- Connecting to db<jupyter_code>import pymysql 

HOST = '192.168.127.12'
PORT = 3360
USER = 'emad'
PASSWORD = '<PASSWORD>'
DB_NAME = 'daricheh_gorge_crawler'

db = pymysql.connect(host=HOST, port=PORT, user=USER, password=PASSWORD, db=DB_NAME)
db
with db.cursor() as cursor:
    cursor.execute(f"SELECT id, likes, comments FROM posts WHERE id in (1, 10, 13)")
    posts = cursor.fetchall()

print("posts:")
print(posts)
with db.cursor() as cursor:
    print("popular posts:")
    cursor.execute(f"SELECT id, likes, comments FROM posts WHERE id BETWEEN 1 AND 10")
    posts = cursor.fetchall()

for row in posts:
    if row[1] > 30:
        print(row)<jupyter_output>popular posts:
(1, 290, 15)
(6, 35, 7)
(7, 75, 3)
(10, 32, 10)
{'fraction_non_alphanumeric': 0.13535353535353536, 'fraction_numerical': 0.05353535353535353, 'mean_word_length': 4.728323699421965, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '533624', 'license': 'MIT', 'n_tokens_mistral': 421, 'n_tokens_neox': 374, 'n_words': 99, 'path': 'Workshops/02. my_sql.ipynb', 'repo_name': 'alimirferdos/Data_Mining_Course', 'size': '1008'}