django - Syncdb - access denied but mysql -u root -p - access granted -
i'm trying access database through django (`bitnami djangostack). here databases settings:
databases = { 'default': { 'engine': 'django.db.backends.mysql', 'name': 'djangostack', 'host': '/opt/bitnami/mysql/tmp/mysql.sock', #or 127.0.0.1 'port': '3306', 'user': 'root', 'password': 'bitnami' } } when execute python manage.py syncdb get:
1045, access denied user 'root'@'localhost' (using password: yes) but can login mysql username , password.
djangostack db exists.
how possible?
you can find out possible bug in code doing testing :)
1)create new user in mysql , utilize in settings.py , test:
grant privileges on djangostack.* 'user'@'hostname' identified 'password'; giving permissions user on djangostack database:
grant privileges on djangostack.* 'user'@'hostname' 2) remove port argument test *default port 8000.so admin accessible @ localhost:8000/admin
3) alter host 127.0.0.1 test
mysql django
No comments:
Post a Comment