python - Ansible mysql_user 与 Percona 57 和 RHEL7

标签 python mysql ansible percona rhel7

我正在尝试在 RHEL7 和 Percona 57 上使用 ansible mysql_user 模块 但它失败了

the python mysqldb module is required

我已经安装了完整的 Percona 57 我还尝试安装 yum install MySQL-python。 (1.2.3) 但在 Python 中,当我尝试导入 MySQLdb 时,我得到

ImportError: libmysqlclient.so.18: cannot open shared object file: No such file or directory

pip 安装 MySQL-python 因错误而失败 (1.2.5)

unable to execute gcc: No such file or directory
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-_9GWXZ/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-rmYnmt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-_9GWXZ/MySQL-python

还有其他人遇到过这个问题吗?

最佳答案

所以最后我发现是 SELinux 阻塞了端口 ><

关于python - Ansible mysql_user 与 Percona 57 和 RHEL7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38746361/

相关文章:

php - mysql 查询不起作用

ansible - 在 Ansible 的 lineinfile 任务中的正则表达式中使用 {{item}}

python - Jupyter Notebook PySpark OSError [WinError 123] 文件名、目录名或卷标语法不正确 :

mysql - 带有 COUNT(..) 的简单准备语句不起作用

python - 多次出现的单词的 NLTK 索引

Java Web Service 进行 JPA-MySql 插入,但插入后不进行选择

loops - 如何在 jinja2 模板中构建此循环

Ansible 任务 - 如何循环所有预定义的变量以这种格式创建 Linux 组?

python - 机器人框架中有没有一种方法可以仅在存在 True 时才记录 keywork?

python - 如何将 MLP 的数据调整为 LSTM(预期 ndim=3,发现 ndim=2 错误)