码迷,mamicode.com
首页 > 数据库 > 详细

Django syncdb mysql error on localhost -> (1045, "Access denied for user 'ODBC'@'localhost')

时间:2017-09-17 19:06:34      阅读:279      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!