New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysql_user broken in 2.7.1 when using /root/.my.cnf #47736
Comments
Hi @epeli, thank you for submitting this issue! |
Files identified in the description: If these files are inaccurate, please update the |
Have you tried the same already in a different order? Meaning basically: First logging in without any password, setting the root password and afterwards generating the .my.cnf? Which python DB connector are you using these days? MySQLdb or PyMySQL? |
Hi All,
Running:
Error:
|
Seems same issue with mysql_db - moving back to ansible v2.7.0 resolved the issue. |
I don't know where that was, but some time (weeks? months?) ago I looked into a similar problem, and the reason was that MySQLdb (which is based on libmysql) was using Unix sockets to connect by default, while PyMySQL was connecting via TCP to As I said, I don't really remember where I wrote this before, and I'm not really sure about the details anymore, but maybe this gives one of you having this problem a hint on how to solve it :) |
Ok, I found it. It was a discussion on #ansible-devel on October 2nd, and the user who had a problem connecting (he first suspected that handling of an empty string password was the problem) finally found out that he needs to use Anyway, @epeli @anniemelen @bchanan03, can you try out the |
Hello, |
Sorry until now, i think this bug still not being resolved. |
@nizarakbarm have you tried what I suggested and @efflamlemaillet tried and verified? It would be nice if you could try that, and confirm whether it works (or not!) here. |
Hi @felixfontein, on Ubuntu 18.04 the given work-around by @efflamlemaillet fixes the problem |
Hi, |
@felixfontein It work, but i don't like to use ~/.my.cnf |
@nizarakbarm |
@efflamlemaillet to be more precise, it is not the Ansible module itself, but the Python MySQL connection library it uses. The old library, MySQLdb (which is based on libmysql), prefers Unix sockets, while the new library, PyMySQL, prefers a TCP connection. If you're explicit in your playbook/role and specify how to connect, that doesn't matter; but if you don't, it depends on which library the module is using. The module tries PyMySQL first, and falls back to MySQLdb if PyMySQL is not available. |
Oke, thanks for your response. @felixfontein From your answer, it can help me to understand the reason of the problem. |
The whole thing is to know if it should be considered as a bug ? |
* renamed deprecated state ('installed' -> 'present') [1] ansible/ansible#47736
now /root/.my.cnf and specifying socket required. see: ansible/ansible#47736
- Don't anticipate the users to change it, so removing the option. - Add the config_file param to other tasks using ansible modules. For reference, the workaround with config_file is needed due to a change in mysql libs used by ansible (see ansible/ansible#47736)
- Don't anticipate the users to change it, so removing the option. - Add the config_file param to other tasks using ansible modules. For reference, the workaround with config_file is needed due to a change in mysql libs used by ansible (see ansible/ansible#47736)
In my case this workaround also helped
|
Thanks @felixfontein for pointing this out ! Had to update every |
i explained this in the doc #66848 |
close_me |
SUMMARY
When upgrading from 2.7.0 to 2.7.1 we started seeing this error from
mysql_user
moduleThe task is following:
The latter one fails.
Ansible 2.7.0 works fine.
ISSUE TYPE
COMPONENT NAME
mysql_user
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
macOS Mojave version 10.14 (18A391)
And Ubuntu 18.04 server
STEPS TO REPRODUCE
See SUMMARY
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: