worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.36k stars 1.43k forks source link

Access denied while running example.py #191

Closed zockerwurf closed 5 years ago

zockerwurf commented 5 years ago

Hi guys.

I'm working on set up dejavu on my ubuntu system. So far so good - i created the database in the mysql. I also checked the user table:

mysql> SELECT User, Host, plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| User             | Host      | plugin                |
+------------------+-----------+-----------------------+
| root             | localhost | auth_socket           |
| mysql.session    | localhost | mysql_native_password |
| mysql.sys        | localhost | mysql_native_password |
| debian-sys-maint | localhost | mysql_native_password |
| edward           | localhost | auth_socket           |
+------------------+-----------+-----------------------+
5 rows in set (0.00 sec)

When i try to run example.py i get the following error:

edward@edward-virtual-machine:~/dejavu$ sudo python example.py
Traceback (most recent call last):
  File "example.py", line 15, in <module>
    djv = Dejavu(config)
  File "/home/edward/dejavu/dejavu/__init__.py", line 28, in __init__
    self.db.setup()
  File "/home/edward/dejavu/dejavu/database_sql.py", line 157, in setup
    with self.cursor() as cur:
  File "/home/edward/dejavu/dejavu/database_sql.py", line 321, in cursor
    return Cursor(**options)
  File "/home/edward/dejavu/dejavu/database_sql.py", line 344, in __init__
    conn = mysql.connect(**options)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 86, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 204, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1698, "Access denied for user 'edward'@'localhost'")

Looks like something is wrong here with the credentials. But i made sure it is the correct one inside the dejavu.cnf.SAMPLE.

Any idea what's wrong here?

henryfoster commented 4 years ago

Take a look at this: https://stackoverflow.com/a/42742610