我正在尝试从 SQLite3 转移到 MySQL,经过很多困难我终于让 MySQL-python 工作了但是当我尝试运行时./manage.py syncdb
出现错误
OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")
现在我正在通过 MAMP 运行 MySQL。我尝试创建一个新用户而不是使用 root,但我得到了同样的错误。任何帮助/建议将不胜感激,谢谢。
设置.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'db17', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': 'root',
'PASSWORD': 'root',
'HOST': 'localhost', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '8889', # Set to empty string for default.
}
}
这些是 MAMP 给出的设置。