Home  >  Article  >  Database  >  _mysql_exceptions.OperationalError: (2003, "Can&

_mysql_exceptions.OperationalError: (2003, "Can&

WBOY
WBOYOriginal
2016-06-07 15:46:241483browse

在连接数据库中,出现_mysql_exceptions.OperationalError: (2003, Can't connect to MySQL server on 'localhost' (10061)),如下错误,但数据库连接中的用户名,密码即各项setting.py文件中的配置是正确的,但却报错。如图所示: 解决办法是,将‘HOST’:

在连接数据库中,出现_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' (10061)"),如下错误,但数据库连接中的用户名,密码即各项setting.py文件中的配置是正确的,但却报错。如图所示:

_mysql_exceptions.OperationalError: (2003, "Can&


解决办法是,将‘HOST’:‘localhost’改为 ‘HOST’:‘127.0.0.1’,具体原因,不清楚,但修改过后,可执行syncdb ,如图所示:

_mysql_exceptions.OperationalError: (2003, "Can&



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn