Accessing Wordpress database with python

Viewed 701

I'm working on a python script that checks an email account, extracts information from certain emails, and adds this information to an SQL database. I'm able to connect to the database on the server for my personal site while testing the script, but I can't figure out how to connect to the Wordpress database that I need it to insert the data into. I've tried a setup like:

         connection = mysql.connector.connect(host='localhost',
                                             database='{name of database}',
                                             port='3306',
                                             user='{my WP username}',
                                             password='{my WP password}')

but when I run this, I get an error:

"Error while connecting to MySQL 1045 (28000): Access denied for user '{WP username}'@'localhost' (using password: YES)"

I've tried using multiple users and the host as '127.0.0.1' as well, and I get the same error.

Any suggestions would be very much appreciated!

0 Answers
Related