0

我正在尝试从 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 给出的设置。

4

1 回答 1

0

除了创建新用户之外,您是否还授予该用户对项目中表的权限?

GRANT ALL PRIVILEGES ON db17.* TO 'root'@'localhost';
于 2013-07-11T23:09:41.507 回答