Open itcultus opened 2 years ago
a part of the discussion is in https://github.com/ansible-collections/community.mysql/pull/142
@itcultus thanks for reporting this! As a workaround i would suggest trying the mysqlclient
connector instead of PyMySQL. Could you please try it and let us know that it helps?
mysqlclient
is an actively maintained connector (by the same folks who are developing PyMSQL IIRC).
Absolutely! How ? :) Apologies for this so basic question, but I think I need some guidance on this. (And I promise to update the documentation with it!)
It's just a regular pypi package available for installation via pip https://pypi.org/project/mysqlclient/. So i would remove PyMySQL first (via pip also), then would install mysqlclient and try
https://github.com/ansible-collections/community.mysql/pull/142#issuecomment-819333437 and below explains the result of our investigation
I don't use pip for system packages, but there is an RPM from EPEL, so, I will try this one. It's not the latest version (1.4.6) instead of 2.1, but let's give it a try.
Sounds good, thanks. The essence of the result is that PyMySQL works a bit strange with Python3
Is there a way to force this module to use mysqlclient instead of PyMySQL when both are installed?
SUMMARY
The issue is very similar to #140 . When I use the
mysql_query
module with some UTF-8 characters it fails.The SQL Query I use is the following:
The SQL query is part of the
phpipam
installation process that I try to automate with ansible.The query is executed successfully when I use the mysql client without issues. However, when I execute it via ansible with the
mysql_query
module, it fails with the error message:The character that creates the issue is the
č
.ISSUE TYPE
COMPONENT NAME
mysq_query
ANSIBLE VERSION
COLLECTION VERSION
OS / ENVIRONMENT
Target OS:
STEPS TO REPRODUCE
Just run the following task in an relevant DB.
EXPECTED RESULTS
SQL Query should be executed without issue.
ACTUAL RESULTS
SQL Execution fails.