Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 客户端不支持服务器请求的认证协议,考虑升级MySQL客户端_Python_Mysql_Django - Fatal编程技术网

Python 客户端不支持服务器请求的认证协议,考虑升级MySQL客户端

Python 客户端不支持服务器请求的认证协议,考虑升级MySQL客户端,python,mysql,django,Python,Mysql,Django,我想运行python manage.py syncdb以使用Django构建数据库。但是,我得到以下错误: 客户端不支持服务器请求的认证协议考虑升级MySQL客户端< /P> 然后我会这样做: 看来函数mysql.old\u密码不存在。 Djangosetting.py的一部分: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'blog_list',

我想运行python manage.py syncdb以使用Django构建数据库。但是,我得到以下错误:

客户端不支持服务器请求的认证协议考虑升级MySQL客户端< /P> 然后我会这样做:

看来函数mysql.old\u密码不存在。

Django
setting.py的一部分:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'blog_list',
        'USER': 'blog_listuser',
        'PASSWORD': '4cZbmXZyyHpAA0oT',
        'HOST': 'localhost',
        'PORT': '3306',
    }
}
我使用Windows7和MySQL 5.7.10

以下是数据库日志错误的一部分:

2016-02-09T07:55:09.032900Z 0 [Note] InnoDB: Waiting for purge to start
2016-02-09T07:55:09.157700Z 0 [Note] InnoDB: Waiting for purge to start
2016-02-09T07:55:09.282500Z 0 [Note] InnoDB: 5.7.10 started; log sequence number 2536368
2016-02-09T07:55:09.282500Z 0 [Note] InnoDB: not started
2016-02-09T07:55:09.547701Z 0 [Note] InnoDB: Loading buffer pool(s) from D:\mysql-5.7.10-win32\data\ib_buffer_pool
2016-02-09T07:55:15.616111Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 6381ms. The settings might not be optimal. (flushed=36 and evicted=0, during the time.)
2016-02-09T07:55:17.659715Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-02-09T07:55:17.690915Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160209 15:55:17
2016-02-09T07:55:18.985717Z 0 [Warning] System table 'plugin' is expected to be transactional.
2016-02-09T07:55:19.188518Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-02-09T07:55:19.219718Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-02-09T07:55:19.266518Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2016-02-09T07:55:19.266518Z 0 [Note] IPv6 is available.
2016-02-09T07:55:19.297718Z 0 [Note]   - '::' resolves to '::';
2016-02-09T07:55:19.360118Z 0 [Note] Server socket created on IP: '::'.
2016-02-09T07:55:19.547318Z 0 [Warning] Failed to open optimizer cost constant tables

2016-02-09T07:55:21.965322Z 0 [Warning] The plugin '*C6E2795BB700C59FE4A4A8E2559543B1AD0263D4' used to authenticate user 'blog_listuser'@'localhost' is not loaded. Nobody can currently login using this account.
2016-02-09T07:55:22.027723Z 0 [Warning] System table 'time_zone_leap_second' is expected to be transactional.
2016-02-09T07:55:22.027723Z 0 [Warning] System table 'time_zone_name' is expected to be transactional.
2016-02-09T07:55:22.027723Z 0 [Warning] System table 'time_zone' is expected to be transactional.
2016-02-09T07:55:22.027723Z 0 [Warning] System table 'time_zone_transition_type' is expected to be transactional.
2016-02-09T07:55:22.027723Z 0 [Warning] System table 'time_zone_transition' is expected to be transactional.
2016-02-09T07:55:22.090123Z 0 [Warning] System table 'servers' is expected to be transactional.
2016-02-09T07:55:36.317347Z 0 [ERROR] Incorrect definition of table mysql.db: expected column 'User' at position 2 to have type char(32), found type char(16).
2016-02-09T07:55:36.332948Z 0 [ERROR] mysql.user has no `Event_priv` column at position 28
2016-02-09T07:55:36.364148Z 0 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
2016-02-09T07:55:36.379748Z 0 [Note] MySQL: ready for connections.
Version: '5.7.10'  socket: ''  port: 3306  MySQL Community Server (GPL)
2016-02-09T09:13:27.113995Z 3 [Warning] The plugin 'mysql_old_password' used to authenticate user 'blog_listuser'@'localhost' is not loaded. Nobody can currently login using this account.
2016-02-09T09:13:27.361009Z 3 [Warning] System table 'servers' is expected to be transactional.
2016-02-09T12:30:51.052347Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 11551607ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)

Django不会自动生成您的数据库。同步或迁移之前必须先创建它。另外,您需要在python包列表上安装
MySQLDB
包。但是如果您使用的是Python3,那么我建议您使用PyMySQL,然后在
设置.py

import pymysql

pymysql.install_as_MySQLdb()
我也有类似的问题, 我将
import MySQLdb
替换为

import pymysql
pymysql.install_as_MySQLdb()
设置中.py


我正在使用MySQLdb版本1.2.5、PyMySQ版本0.9.2、Python 2.7和Django 1.11.2。

我用phpmyadmin设置了mysql的权限,没问题