Mas*_*olo 14 mysql django privileges
我已经开始使用django了,在settings.py中设置'DATABASES'后,这是'runserver'上的错误
mysql_exceptions.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)") 
我的settings.py部分代码:
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'my_site',                      # Or path to database file if using sqlite3.
        'USER': 'root',                      # Not used with sqlite3.
        'PASSWORD': 'root',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}
我创建了'my_site'数据库,并以正确的方式设置权限(root具有所有权限).我用'phpmyadmin'完成了这个操作.
出了什么问题?
Akh*_*N S 14
在控制台中运行
mysql> grant all privileges on *.* to root@localhost identified by 'password' with grant option;
| 归档时间: | 
 | 
| 查看次数: | 51785 次 | 
| 最近记录: |