I am working on a project which includes sensing gas particles from mq6 sensor and attain approx. readings from it and send those readings to the mysql database in wamp server on my windows desktop. I have already setup database and tables for the storing data in mysql database on wamp server. I am using the following code to connect to the external mysql database from my raspberry using python script.
import MySQLdb
try:
conn = MySQLdb.connect(host="192.168.*.*",
user="username",
passwd="password",
db="databasename")
c = conn.cursor()
except MySQLdb.Error,e:
print "Mysql Error %d: %s" % (e.args[0], e.args[1])
After executing the code an error occurs which as follows:
Mysql Error 1045: Access denied for user 'username'@'192.168.*.*' (using password: YES)
I think connection is not established between raspberry python script and mysql database in wamp server on my desktop. Really need help for solving it.I have tried everything and now I ran out of options.