解决安装mysqlclient出现如下问题:

Complete output from command python setup.py egg_info:
/bin/sh: : mysql_config: not found
Traceback (most recent call last):
File "<string>", line , in <module>
File "/tmp/pip-install-7qo1k7as/mysqlclient/setup.py", line , in <module>
metadata, options = get_config()
File "/tmp/pip-install-7qo1k7as/mysqlclient/setup_posix.py", line , in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-install-7qo1k7as/mysqlclient/setup_posix.py", line , in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found ----------------------------------------
Command "python setup.py egg_info" failed with error code in /tmp/pip-install-7qo1k7as/mysqlclient/

安装mysql:

sudo apt-get install mysql-server mysql-client
然后mysql -V查看mysql是否安装成功
sudo apt-get install libmysqlclient-dev python3-dev
然后
pip install mysqlclient就不会报错找不到'mysql_config'了 # mysql5.7创建用户并授权:
创建数据库 mysql> CREATE USER 'office'@'%' IDENTIFIED BY 'office'; mysql> CREATE DATABASE office DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; mysql> grant all privileges on office.* to office@'%' identified by 'office'; mysql> flush privileges;


修改密码:
set password for root@'localhost'=password('xxxx');
注意@'localhost不能省略 ```

本文主要摘自:https://www.cnblogs.com/lajiao/p/9176060.html

解决安装mysqlclient出现问题:mysql_config: not found的更多相关文章

  1. python安装mysqlclient模块时报mysql_config not found解决方法

    在配置Flask框架,安装mysqlclient时报一下错误 翻译了一下大概是 mysql_config  文件没找到, 解决方法是安装缺失的文件. sudo apt install libmysql ...

  2. 安装mysqlclient报OSError: mysql_config not found

    输入命令: :~$ pip install mysqlclient 报错: Collecting mysqlclient Using cached https://files.pythonhosted ...

  3. MacOS 下安装mysqlclient 的问题及解决办法

    [操作环境] 操作系统:MacOS X 10.13.1 mysql运行环境:Docker Docker版本:17.09-ce 在开发Django时,刚开始使用的sqlite进行开发,想部署到生产环境需 ...

  4. 安装Python mysqlclient出现“OSError: mysql_config not found”错误

    问题:               使用Python3开发一个管理平台,用MySQL数据库存放元数据.使用pip安装mysqlclient模块时出现“OSError: mysql_config not ...

  5. python安装mysqlclient模块报fatal error: Python.h:解决方法

    在搭建Flask框架安装mysqlclient模块时候老是报fatal error: Python.h:错误,折腾老半天,百度了老半天看了不少大神帖子,就是没解决, 后来发现这不是个BUG,都是自己的 ...

  6. 解决django项目在ubuntu系统上无法安装mysqlclient

    首先我的项目是django2.0,python环境是3.5. 我们在本地开发完django项目了,在本地运行是成功的,然后我们把django项目放到服务器上,运行的时候就出错了. 如图: 我们都知道, ...

  7. 安装 mysqlclient 报 mysql_config not found

    安装 mysqlclient 报 mysql_config not found raise EnvironmentError("%s not found" % (mysql_con ...

  8. python3安装mysqlclient,解决django使用pymysql报错的问题

    1.起因 在django中为了使用MySQL,一般是在项目目录下的__init__.py中添加 import pymysql pymysql.install_as_MySQLdb() # 使用pymy ...

  9. 解决Mac上安装mysqlclient的错误

       要想使用python操作mysql,那么就需要安装python操作数据库的驱动,由于mysqldb不支持python3,我选择安装mysqlclient, 命令行输入:pip3 install  ...

随机推荐

  1. JAVA中静态块、静态变量加载顺序详解

    http://blog.csdn.net/mrzhoug/article/details/51581994 一般顺序:静态块(静态变量)——>成员变量——>构造方法——>静态方法

  2. python 字典value排序

    #!/usr/bin/env python#coding:utf-8s = {“a”:1,”b”:3,”c”:2} print sorted(s.iteritems(),key=lambda t:t[ ...

  3. python读写xml文件

    python读取xml文件 xml文件是具有树状结构的,如果想要访问某个叶子结点,必须逐层获取其父结点,要读取某个叶子结点内容用text成员 使用前先加载xml工具包 try: import xml. ...

  4. head first (三):装饰者模式

    看到别人写的,都看不进去,算了还是自己手写一遍吧,算是帮助自己理解了.写的比较简单,例子也比较好懂,什么时候使用自己看着办. 1.定义 装饰者模式:动态地将职责附加到对象上.若要扩展功能,装饰者提供比 ...

  5. 四十八 常用内建模块 HTMLParser

    如果我们要编写一个搜索引擎,第一步是用爬虫把目标网站的页面抓下来,第二步就是解析该HTML页面,看看里面的内容到底是新闻.图片还是视频. 假设第一步已经完成了,第二步应该如何解析HTML呢? HTML ...

  6. 使用 ceph 作为 openstack 的后端

    openstack 与 ceph 集成 在 ceph 上创建 openstack 需要的 pool. sudo ceph osd pool create volumes 128 sudo ceph o ...

  7. 运行时候报异常could only be replicated to 0 nodes instead of minReplication (=1). There are 2 datanode(s) running and no node(s) are excluded in this operation.

    运行时候报异常could only be replicated to 0 nodes instead of minReplication (=1).  There are 2 datanode(s) ...

  8. go chapter 8 - 初始化对象

    http://blog.haohtml.com/archives/14239 struct定义的属性如果是小写开头的,那么该属性不是public的,不能跨包调用 (implicit assignmen ...

  9. Luogu P4148 简单题(K-D Tree)

    题面 题解 因为强制在线,所以我们不能$cdq$分治,所以考虑用$KDT$,$KDT$维护一个矩阵,然后询问的时候如果当前矩形在询问区间内,直接记贡献,否则判断当前点是否在矩阵内,然后左右分别递归下去 ...

  10. Luogu P3258 松鼠的新家(树链剖分+线段树/树状数组)

    题面 题解 这种题目一看就是重链剖分裸题,还是区间修改,单点查询,查询之前在遍历时要记一个\(delta\),因为这一次的起点就是上一次的终点,不需要放糖,所以可以用\(BIT\)来写,但我写完\(m ...