Search code examples
mysqlpython-2.7audioaudio-fingerprinting

Dejavu - Audio Fingerprinting in Python


I have installed all dependencies as requested in the https://github.com/worldveil/dejavu/blob/master/INSTALLATION.md

I am using Ubuntu 14.4 I am new to Linux.

I installed MYSQLDB and created a database called 'dejavu'. When I run this command in Terminal I got the following errors.

> paul@paul-HP-Pavilion-dv6700-Notebook-PC:~/dejavu$ python dejavu.py
> --recognize mic 10 Traceback (most recent call last):   File "dejavu.py", line 64, in <module>
>     djv = init(config_file)   File "dejavu.py", line 31, in init
>     return Dejavu(config)   File "/home/paul/dejavu/dejavu/__init__.py", line 28, in __init__
>     self.db.setup()   File "/home/paul/dejavu/dejavu/database_sql.py", line 158, in setup
>     with self.cursor() as cur:   File "/home/paul/dejavu/dejavu/database_sql.py", line 322, in cursor
>     return Cursor(**options)   File "/home/paul/dejavu/dejavu/database_sql.py", line 345, in __init__
>     conn = mysql.connect(**options)   File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in
> Connect
>     return Connection(*args, **kwargs)   File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187,
> in __init__
>     super(Connection, self).__init__(*args, **kwargs2)
> _mysql_exceptions.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)")

I am guessing it is something to do with the way I have Dejavu linked or not linked to my Database.

Any help at all would be greatly appreciated. Thank you.


Solution

  • This looks like you have a password set for your MySQL database, and the default dejavu config specifies no password.

    To run the examples, you need to change the dejavu.cnf.SAMPLE file with the settings of your MySQL database:

    {
        "database": {
            "host": "127.0.0.1",
            "user": "root",
            "passwd": "<root_password>",
            "db": "dejavu"
        }
    }