(1045, "Access denied for user 'www-data'@'localhost' (using password: YES)")
it looks like there is still a permission issue which I suspect is either
(1) An incorrect owner and group on the file system. Since you did a "sudo chown -R www-data:www-data /opt/sana" I don't believe that is the case here. However, you should probably check any links on the file system that point to /opt/sana. If you followed the wiki instructions there should be one from /var/www/mds to /opt/sana.
(2) A problem with the database user or password. It may be related to having an empty string for the DATABASE_USER setting. I suspect that the db user may be getting defaulted use 'www-data' but I haven't been able to find anything to that effect in the
Django doc's yet for your version although I suspect I may have just missed it. I would recommend adding an mds specific user with the appropriate permissions. Just open a mysql prompt and do something like:
$> CREATE USER '$USERNAME'@'localhost' IDENTIFIED BY '****';
$> GRANT ALL ON mds.* TO '$USERNAME'@'localhost';
Replace $USERNAME with whatever you would like and then sync the db.
Hope that helps.
Best,
Eric