Closed jgainey closed 9 months ago
I find I'm running into the same issue. Originally maybe it seemed as though a mysql install left the root password empty as ''. Or perhaps that the install was not performed with some package manager like yum for example on RHEL. But using yum on RHEL7 to install mysql from the rpm files it does as @jgainey describes. The default installation password is written to /var/log/mysqld.log
. I can scrape that and write it to a var in ansible but this still doesn't seem to yield results and fails. I've tested this and found it true for mysql 5.7 and 8.0.
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read this blog post to see the reasons why I mark issues as stale.
This issue is no longer marked for closure.
I did fork this, it may or may not work for you. https://github.com/jgainey/ansible-role-mysql
On Wed, May 4, 2022 at 9:06 AM Chad Hollman @.***> wrote:
I find I'm running into the same issue. Originally maybe it seemed as though a mysql install left the root password empty as ''. Or perhaps that the install was not performed with some package manager like yum for example on RHEL. But using yum on RHEL7 to install mysql from the rpm files it does as @jgainey https://github.com/jgainey describes. The default installation password is written to /var/log/mysqld.log. I can scrape that and write it to a var in ansible but this still doesn't seem to yield results and fails. I've tested this and found it true for mysql 5.7 and 8.0.
— Reply to this email directly, view it on GitHub https://github.com/geerlingguy/ansible-role-mysql/issues/484#issuecomment-1117290068, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASCKL2F4OV7CBZYIMDZOGTVIJY3TANCNFSM5RCQN4SQ . You are receiving this because you were mentioned.Message ID: @.***>
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read this blog post to see the reasons why I mark issues as stale.
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read this blog post to see the reasons why I mark issues as stale.
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
The issue is still active, there are no way as of today to use the role on RHEL compliant distribution while using the official MySQL 8 release. I could not find a way to workaround this unfortunately.
I'm trying to install mysql5.7 from the community repo. everything seems to go fine until it tries to access the mysql database with the mysql command line client
TASK [mysql : Disallow root login remotely] ***** failed: [css-mfgweb1-t7.cookgroup.nao] (item=DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')) => {"ansible_loop_var": "item", "changed": false, "cmd": ["mysql", "-NBe", "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')"], "delta": "0:00:00.012698", "end": "2022-03-18 13:32:49.616623", "item": "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')", "msg": "non-zero return code", "rc": 1, "start": "2022-03-18 13:32:49.603925", "stderr": "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)", "stderr_lines": ["ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)"], "stdout": "", "stdout_lines": []}
i looked through the code it seems like it should need to:
here's the snippet from the log with the randomly generated temporary password:
2022-03-18T17:32:45.659519Z 1 [Note] A temporary password is generated for root@localhost: 0,h0pQfs7J8l
i'm not familiar with new versions of mysql and whether this is the same or not.