Unable to install mysqlclient on centos

前端 未结 5 2137
别跟我提以往
别跟我提以往 2021-01-14 05:36

I am building a django app and for which i need to configure mysql.I am trying to install mysqlclient module for sql connection and this is what i am trying

         


        
5条回答
  •  孤独总比滥情好
    2021-01-14 06:11

    I found this solution at https://github.com/r-dbi/RMySQL/issues/197:

    I think this is a bug in that custom MariaDB repo. Their package MariaDB-devel-10.2.6-1.fc25.x86_64 only contains a library named:

    /usr/lib64/libmariadbclient.a
    

    However their pkg-config yields another name:

    > pkg-config --libs mariadb
        -lmariadb
    

    You best raise this at the maintainers of that repo. A workaround is to symlink libmariadbclient.a to libmariadb.a:

    sudo ln -s /usr/lib64/libmariadbclient.a /usr/lib64/libmariadb.a
    

    That fixes the installation.

    So basically to have mysqlclient install in Python 3.6 and CentOS 7 you need to run:

    sudo yum install -y python36-devel mysql-devel gcc
    
    sudo ln -s /usr/lib64/libmariadbclient.a /usr/lib64/libmariadb.a
    
    pip install mysqlclient
    

提交回复
热议问题