Skip to content

Instantly share code, notes, and snippets.

@zilista
Created November 5, 2020 08:51
Show Gist options
  • Save zilista/96cf3c1aa30bb650e9f271a1b80bf7ed to your computer and use it in GitHub Desktop.
Save zilista/96cf3c1aa30bb650e9f271a1b80bf7ed to your computer and use it in GitHub Desktop.
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment