标签:django
环境:WINDOWS系统
将数据库配置
DATABASES = {
‘default‘: {
‘ENGINE‘: ‘django.db.backends.mysql‘,
‘HOST‘: ‘localhost‘,
‘PORT‘: 3306,
‘NAME‘: ‘yunwei‘,
‘USERNAME‘: ‘root‘,
‘PASSWORD‘: ‘mysql‘,
}
}
改为
DATABASES = {
‘default‘: {
‘ENGINE‘: ‘django.db.backends.mysql‘,
‘HOST‘: ‘localhost‘,
‘PORT‘: 3306,
‘NAME‘: ‘yunwei‘,
‘USER‘: ‘root‘,
‘PASSWORD‘: ‘mysql‘,
}
}
即将USERNAME改为USER,Linux 系统无需更改
查看博文:https://stackoverflow.com/questions/30218252/django-syncdb-mysql-error-on-localhost-1045-access-denied-for-user-odbc
Django syncdb mysql error on localhost -> (1045, "Access denied for user 'ODBC'@'localhost')
标签:django
原文地址:http://linux10000.blog.51cto.com/6338282/1966061