1

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.

Smita Ahinave
  • 1,833
  • 7
  • 19
  • 39

1 Answers1

0

It actually looks to me like the connection IS established. The error you're seeing is a permissions issue. Try this: MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (using password: YES)

Community
  • 1
  • 1
obe
  • 5,787
  • 4
  • 19
  • 31