Skip to content

Instantly share code, notes, and snippets.

import pymysql
sql = """SELECT ID, post_title from wp_posts where post_type='post' and post_status='publish' """
# conn = psycopg2.connect(dbname=f'{dbname}', user=f'{user}', password=f'{password}', host=f'{host}')
conn = pymysql.connect('xx.xx.xx.xxx', 'xxx',
'xxx', 'xxx')
data = pd.read_sql_query(sql, conn)