<legend id='7uVQv'><style id='7uVQv'><dir id='7uVQv'><q id='7uVQv'></q></dir></style></legend>

    <i id='7uVQv'><tr id='7uVQv'><dt id='7uVQv'><q id='7uVQv'><span id='7uVQv'><b id='7uVQv'><form id='7uVQv'><ins id='7uVQv'></ins><ul id='7uVQv'></ul><sub id='7uVQv'></sub></form><legend id='7uVQv'></legend><bdo id='7uVQv'><pre id='7uVQv'><center id='7uVQv'></center></pre></bdo></b><th id='7uVQv'></th></span></q></dt></tr></i><div id='7uVQv'><tfoot id='7uVQv'></tfoot><dl id='7uVQv'><fieldset id='7uVQv'></fieldset></dl></div>

      • <bdo id='7uVQv'></bdo><ul id='7uVQv'></ul>
    1. <tfoot id='7uVQv'></tfoot>
    2. <small id='7uVQv'></small><noframes id='7uVQv'>

      无法更改 root 帐户 ansible 的密码

      时间:2023-06-06

        <tfoot id='aRK1L'></tfoot>
          <tbody id='aRK1L'></tbody>
            <bdo id='aRK1L'></bdo><ul id='aRK1L'></ul>

              <small id='aRK1L'></small><noframes id='aRK1L'>

              <legend id='aRK1L'><style id='aRK1L'><dir id='aRK1L'><q id='aRK1L'></q></dir></style></legend>
                <i id='aRK1L'><tr id='aRK1L'><dt id='aRK1L'><q id='aRK1L'><span id='aRK1L'><b id='aRK1L'><form id='aRK1L'><ins id='aRK1L'></ins><ul id='aRK1L'></ul><sub id='aRK1L'></sub></form><legend id='aRK1L'></legend><bdo id='aRK1L'><pre id='aRK1L'><center id='aRK1L'></center></pre></bdo></b><th id='aRK1L'></th></span></q></dt></tr></i><div id='aRK1L'><tfoot id='aRK1L'></tfoot><dl id='aRK1L'><fieldset id='aRK1L'></fieldset></dl></div>
                本文介绍了无法更改 root 帐户 ansible 的密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我有以下错误:

                {"failed": true, "invocation": {"module_args": 
                 {"append_privs": false, "check_implicit_admin": true, "config_file": "/root/.my.cnf", "connect_timeout": 30, "encrypted": false, "host": "rothko", "host_all": false, "login_host": "localhost", "login_password": "", "login_port": 3306, "login_unix_socket": null, "login_user": "root", "name": "root", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "priv": "*.*:ALL,GRANT", "sql_log_bin": true, "ssl_ca": null, "ssl_cert": null, "ssl_key": null, "state": "present", "update_password": "always", "user": "root"}, "module_name": "mysql_user"}, 
                  "item": "rothko", 
                   "msg": "unable to connect to database, 
                    check login_user and login_password are correct or /root/.my.cnf has the credentials. 
                    Exception message: (1045, \"Access denied for user 'root'@'localhost' (using password: NO)\")"}
                

                这些是我的剧本说明和我尝试过的内容:

                These are my playbook instructions and what I've tried:

                #    - name: Create .my.cnf file with root password credentials
                #      become: yes
                #      template: src=".my.cnf.j2" dest="/root/.my.cnf" owner=root group=root mode=0600
                #    - name: Restart mysql
                #      service: name=mysqld state=restarted
                #    - name: Change root user password on first run
                #      mysql_user:
                #        name=root
                #        host=localhost
                #        password={{ mysql_root_password }}
                #        priv=*.*:ALL,GRANT
                    - name: update mysql root password for all root accounts
                      become: yes
                      mysql_user:
                        login_user=root
                        login_password=''
                        name=root
                        host="{{ item }}"
                        password="{{ mysql_root_password }}"
                        check_implicit_admin=yes
                        priv="*.*:ALL,GRANT"
                      with_items:
                        - "{{ ansible_hostname }}"
                        - 127.0.0.1
                        - ::1
                        - localhost
                      ignore_errors: true
                

                这是一个众所周知的问题,我发现了一些可以解决它的问题,但没有解决方案:

                This is a well known problem and I 've found a few questions that treat it but there was no solution for me:

                • 1
                • 2
                • 3

                推荐答案

                这里有更多信息:在 Centos7 上更改 mysql root 密码

                我尝试做一些有意义的事情

                I try to do some ansible stuff

                    - name: Stop MySQL
                      service: name=mysqld state=stopped
                    - name: set environment variables
                      shell: systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
                    - name: Start MySQL
                      service: name=mysqld state=started
                    - name: sql query
                      command:  mysql -u root --execute="UPDATE mysql.user SET authentication_string = PASSWORD('toto') WHERE User = 'root' AND Host = 'localhost';"
                    - name: sql query flush
                      command:  mysql -u root --execute="FLUSH PRIVILEGES"
                    - name: Stop MySQL
                      service: name=mysqld state=stopped
                    - name: unset environment variables
                      shell: systemctl unset-environment MYSQLD_OPTS
                    - name: Start MySQL
                      service: name=mysqld state=started
                

                希望能帮到你

                这篇关于无法更改 root 帐户 ansible 的密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:Ansible 中的 SQL Server 数据库查询 下一篇:如何使用terraform在easydns中自动添加dns条目?

                相关文章

                最新文章

                  <bdo id='K2Z7b'></bdo><ul id='K2Z7b'></ul>
                <tfoot id='K2Z7b'></tfoot>

                1. <small id='K2Z7b'></small><noframes id='K2Z7b'>

                  1. <i id='K2Z7b'><tr id='K2Z7b'><dt id='K2Z7b'><q id='K2Z7b'><span id='K2Z7b'><b id='K2Z7b'><form id='K2Z7b'><ins id='K2Z7b'></ins><ul id='K2Z7b'></ul><sub id='K2Z7b'></sub></form><legend id='K2Z7b'></legend><bdo id='K2Z7b'><pre id='K2Z7b'><center id='K2Z7b'></center></pre></bdo></b><th id='K2Z7b'></th></span></q></dt></tr></i><div id='K2Z7b'><tfoot id='K2Z7b'></tfoot><dl id='K2Z7b'><fieldset id='K2Z7b'></fieldset></dl></div>
                  2. <legend id='K2Z7b'><style id='K2Z7b'><dir id='K2Z7b'><q id='K2Z7b'></q></dir></style></legend>