解決安裝mysqlclient出現問題:mysql_config: not found

來源:互聯網
上載者:User

標籤:har   local   serve   sql   報錯   fail   set   mysql5.7   oca   

解決安裝mysqlclient出現如下問題:

Complete output from command python setup.py egg_info:    /bin/sh: 1: mysql_config: not found    Traceback (most recent call last):      File "<string>", line 1, in <module>      File "/tmp/pip-install-7qo1k7as/mysqlclient/setup.py", line 18, in <module>        metadata, options = get_config()      File "/tmp/pip-install-7qo1k7as/mysqlclient/setup_posix.py", line 53, in get_config        libs = mysql_config("libs_r")      File "/tmp/pip-install-7qo1k7as/mysqlclient/setup_posix.py", line 28, 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 1 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 [email protected]‘%‘ identified by ‘office‘; mysql> flush privileges;
修改密碼:
set password for [email protected]‘localhost‘=password(‘xxxx‘);注意@‘localhost不能省略```

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

解決安裝mysqlclient出現問題:mysql_config: not found

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.