Skip to content
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

on Chapter3, Page 36: unable to connect to database, check login_user and login_password #578

Open
kayg04 opened this issue Mar 17, 2024 · 1 comment

Comments

@kayg04
Copy link

kayg04 commented Mar 17, 2024

On page 36 of the book, the command fails with the following error message. I am thinking mysql needs some more configuration before access is allowed?

$ ansible db -b -m mysql_user -a "name=django host=% password=12345 priv=*:*:ALL host=localhost state=present"
[WARNING]: Found both group and host with same name: db
db | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "msg": "unable to connect to database, check login_user and login_password are correct or /root/.my.cnf has the credentials. Exception message: (1698, \"Access denied for user 'root'@'localhost'\")"
}
@kayg04
Copy link
Author

kayg04 commented Mar 17, 2024

I had to specify login_user and login_password to get it working. I do understand I had the wrong command with priv=*:*:ALL instead of priv=*.*:ALL but even with that corrected, it did not / does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant