2017-03-06 14 views
-4

私は例として見ていたプログラムを実行しようとしています。ショッピングウェブサイトのように、Djangoで提供されている元のデータベースの代わりにMySQLデータベースを使用しています!私はちょうど誰かがこれらのエラーの意味を理解しているかどうかを見たいと思った?任意の情報をいただければ幸いです!私はウェブページのコードを提供していただろうが、それはあまり適合しないだろう!これらのエラーは何を意味しますか? djangoのmysql

Traceback (most recent call last): 
    File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper 
    fn(*args, **kwargs) 
    File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run 
    self.check(display_num_errors=True) 
    File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 374, in check 
    include_deployment_checks=include_deployment_checks, 
    File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 361, in _run_checks 
    return checks.run_checks(**kwargs) 
    File "/Library/Python/2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks 
    new_errors = check(app_configs=app_configs) 
    File "/Library/Python/2.7/site-packages/django/core/checks/model_checks.py", line 30, in check_all_models 
    errors.extend(model.check(**kwargs)) 
    File "/Library/Python/2.7/site-packages/django/db/models/base.py", line 1266, in check 
    errors.extend(cls._check_fields(**kwargs)) 
    File "/Library/Python/2.7/site-packages/django/db/models/base.py", line 1337, in _check_fields 
    errors.extend(field.check(**kwargs)) 
    File "/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py", line 893, in check 
    errors = super(AutoField, self).check(**kwargs) 
    File "/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py", line 208, in check 
    errors.extend(self._check_backend_specific_checks(**kwargs)) 
    File "/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py", line 311, in _check_backend_specific_checks 
    return connections[db].validation.check_field(self, **kwargs) 
    File "/Library/Python/2.7/site-packages/django/db/backends/mysql/validation.py", line 41, in check_field 
    field_type = field.db_type(connection) 
    File "/Library/Python/2.7/site-packages/django/db/models/fields/__init__.py", line 629, in db_type 
    return connection.data_types[self.get_internal_type()] % data 
    File "/Library/Python/2.7/site-packages/django/db/__init__.py", line 33, in __getattr__ 
    return getattr(connections[DEFAULT_DB_ALIAS], item) 
    File "/Library/Python/2.7/site-packages/django/utils/functional.py", line 35, in __get__ 
    res = instance.__dict__[self.name] = self.func(instance) 
    File "/Library/Python/2.7/site-packages/django/db/backends/mysql/base.py", line 183, in data_types 
    if self.features.supports_microsecond_precision: 
    File "/Library/Python/2.7/site-packages/django/utils/functional.py", line 35, in __get__ 
    res = instance.__dict__[self.name] = self.func(instance) 
    File "/Library/Python/2.7/site-packages/django/db/backends/mysql/features.py", line 54, in supports_microsecond_precision 
    return self.connection.mysql_version >= (5, 6, 4) and Database.version_info >= (1, 2, 5) 
    File "/Library/Python/2.7/site-packages/django/utils/functional.py", line 35, in __get__ 
    res = instance.__dict__[self.name] = self.func(instance) 
    File "/Library/Python/2.7/site-packages/django/db/backends/mysql/base.py", line 367, in mysql_version 
    with self.temporary_connection() as cursor: 
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__ 
    return self.gen.next() 
    File "/Library/Python/2.7/site-packages/django/db/backends/base/base.py", line 564, in temporary_connection 
    cursor = self.cursor() 
    File "/Library/Python/2.7/site-packages/django/db/backends/base/base.py", line 231, in cursor 
    cursor = self.make_debug_cursor(self._cursor()) 
    File "/Library/Python/2.7/site-packages/django/db/backends/base/base.py", line 204, in _cursor 
    self.ensure_connection() 
    File "/Library/Python/2.7/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection 
    self.connect() 
    File "/Library/Python/2.7/site-packages/django/db/utils.py", line 94, in __exit__ 
    six.reraise(dj_exc_type, dj_exc_value, traceback) 
    File "/Library/Python/2.7/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection 
    self.connect() 
    File "/Library/Python/2.7/site-packages/django/db/backends/base/base.py", line 171, in connect 
    self.connection = self.get_new_connection(conn_params) 
    File "/Library/Python/2.7/site-packages/django/db/backends/mysql/base.py", line 263, in get_new_connection 
    conn = Database.connect(**conn_params) 
    File "/Library/Python/2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect 
    return Connection(*args, **kwargs) 
    File "/Library/Python/2.7/site-packages/MySQLdb/connections.py", line 193, in __init__ 
    super(Connection, self).__init__(*args, **kwargs2) 
django.db.utils.OperationalError: (1045, "Access denied for user 'abc'@'localhost' (using password: YES)") 
+3

をneedthisあなたの設定で構成されたMySQLのユーザーはMySQLデータベースにアクセスすることを許可されていない – timgeb

+0

最後の行を読んでください。これは最後の行にプレーンテキストで書かれています。 –

答えて

0

これは、MySQLデータベースへの接続に使用している接続文字列(Djangoのデータベース認証情報)が間違っていることを意味します。 settings.pyであなたのユーザ名、パスワード、ホスト、ポート、DB名を確認し、データベースがサーバからの接続を受け入れていることを確認してください。

関連する問題