久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='9fJUr'></tfoot>

<small id='9fJUr'></small><noframes id='9fJUr'>

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

        在 ubuntu 上使用 ansible 安裝 MySQL

        Install MySQL with ansible on ubuntu(在 ubuntu 上使用 ansible 安裝 MySQL)
        <i id='Px8rc'><tr id='Px8rc'><dt id='Px8rc'><q id='Px8rc'><span id='Px8rc'><b id='Px8rc'><form id='Px8rc'><ins id='Px8rc'></ins><ul id='Px8rc'></ul><sub id='Px8rc'></sub></form><legend id='Px8rc'></legend><bdo id='Px8rc'><pre id='Px8rc'><center id='Px8rc'></center></pre></bdo></b><th id='Px8rc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Px8rc'><tfoot id='Px8rc'></tfoot><dl id='Px8rc'><fieldset id='Px8rc'></fieldset></dl></div>
      2. <tfoot id='Px8rc'></tfoot>

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

          <bdo id='Px8rc'></bdo><ul id='Px8rc'></ul>
        • <legend id='Px8rc'><style id='Px8rc'><dir id='Px8rc'><q id='Px8rc'></q></dir></style></legend>

                    <tbody id='Px8rc'></tbody>

                  本文介紹了在 ubuntu 上使用 ansible 安裝 MySQL的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我在流浪的 ubuntu 上安裝帶有 ansible 的 MySQL 時(shí)遇到問(wèn)題,

                  I have a problem installing MySQL with ansible on a vagrant ubuntu,

                  這是我的 MySQL 部分

                  This is my MySQL part

                  ---
                  - name: Install MySQL
                    apt:
                      name: "{{ item }}"
                    with_items:
                      - python-mysqldb
                      - mysql-server
                  
                  - name: copy .my.cnf file with root password credentials
                    template: 
                      src: templates/root/.my.cnf
                      dest: ~/.my.cnf
                      owner: root
                      mode: 0600
                  
                  - name: Start the MySQL service
                    service: 
                      name: mysql 
                      state: started
                      enabled: true
                  
                    # 'localhost' needs to be the last item for idempotency, see
                    # http://ansible.cc/docs/modules.html#mysql-user
                  - name: update mysql root password for all root accounts
                    mysql_user: 
                      name: root 
                      host: "{{ item }}" 
                      password: "{{ mysql_root_password }}" 
                      priv: "*.*:ALL,GRANT"
                    with_items:
                      - "{{ ansible_hostname }}"
                      - 127.0.0.1
                      - ::1
                      - localhost 
                  

                  我有這個(gè)錯(cuò)誤

                  failed: [default] => (item=vagrant-ubuntu-trusty-64) => {"failed": true, "item": "vagrant-ubuntu-trusty-64"}
                  msg: unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials
                  failed: [default] => (item=127.0.0.1) => {"failed": true, "item": "127.0.0.1"}
                  msg: unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials
                  failed: [default] => (item=::1) => {"failed": true, "item": "::1"}
                  msg: unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials
                  failed: [default] => (item=localhost) => {"failed": true, "item": "localhost"}
                  msg: unable to connect to database, check login_user and login_password are correct or ~/.my.cnf has the credentials
                  

                  我的 .my.cnf 是

                  my .my.cnf is

                  [client]
                  user=root
                  password={{ mysql_root_password }}
                  

                  當(dāng)復(fù)制到服務(wù)器上時(shí)

                  [client]
                  user=root
                  password=root
                  

                  我不明白為什么,創(chuàng)建了 ~/.my.cnf

                  I don't understand why, ~/.my.cnf is created

                  項(xiàng)目 Github

                  謝謝

                  推薦答案

                  當(dāng) mysql-server 無(wú)頭安裝時(shí),沒有密碼.因此,要使 .my.cnf 工作,它應(yīng)該有一個(gè)空白的密碼行.這是我為 .my.cnf 測(cè)試的內(nèi)容:

                  When mysql-server is installed headlessly, there's no password. Therefore to make .my.cnf work, it should have a blank password line. Here's what I tested with for a .my.cnf:

                  [client]
                  user=root
                  password=
                  

                  .my.cnf 放在您的 vagrant 用戶目錄中也有點(diǎn)奇怪,因?yàn)樗?root 擁有并且只能作為 root 讀取.

                  It's also slightly strange to put .my.cnf in your vagrant user directory as owned by root and only readable as root.

                  確保 .my.cnf 中的密碼為空后,我能夠在這四個(gè)上下文中正確設(shè)置 root 的密碼.請(qǐng)注意,此后它無(wú)法運(yùn)行,因?yàn)樾枰?.my.cnf,因此它無(wú)法通過(guò)冪等性測(cè)試.

                  After ensuring the password was blank in .my.cnf, I was able to properly set the password for root in those four contexts. Note that it fails to run after that, since .my.cnf would need to be updated, so it fails the idempotency test.

                  ansible mysql_user 模塊頁(yè)面上有一條注釋,建議先寫密碼,然后然后.my.cnf 文件.如果你這樣做,你需要一個(gè) where 子句到 mysql_user 操作(可能在此之前有一個(gè)文件統(tǒng)計(jì)信息).

                  There's a note on the ansible mysql_user module page that suggests writing the password and then writing the .my.cnf file. If you do that, you need a where clause to the mysql_user action (probably with a file stat before that).

                  更優(yōu)雅的是將 check_implicit_adminlogin_userlogin_password 一起使用.這真是冪等的.

                  Even more elegant is to use check_implicit_admin along with login_user and login_password. That's beautifully idempotent.

                  作為第三種方式,也許 check_implicit_admin 會(huì)更容易.

                  As a third way, perhaps check_implicit_admin makes it even easier.

                  這是我成功的劇本,展示了上述內(nèi)容,并在幾臺(tái)新服務(wù)器上進(jìn)行了測(cè)試.有點(diǎn)為此感到自豪.注意所有這些都不需要 .my.cnf.

                  Here's my successful playbook showing the above, tested with a few fresh servers. Kinda proud of this. Note .my.cnf is unnecessary for all of this.

                  ---
                  - hosts: mysql
                    vars:
                      mysql_root_password: fart
                    tasks:
                    - name: Install MySQL
                      apt: name={{ item }} update_cache=yes cache_valid_time=3600 state=present
                      sudo: yes
                      with_items:
                      - python-mysqldb
                      - mysql-server
                    #- name: copy cnf
                    #  copy: src=.my.cnf dest=~/.my.cnf owner=ubuntu mode=0644
                    #  sudo: yes
                    - name: Start the MySQL service
                      sudo: yes
                      service: 
                        name: mysql 
                        state: started
                        enabled: true
                    - name: update mysql root password for all root accounts
                      sudo: yes
                      mysql_user: 
                        name: root 
                        host: "{{ item }}" 
                        password: "{{ mysql_root_password }}"
                        login_user: root
                        login_password: "{{ mysql_root_password }}"
                        check_implicit_admin: yes
                        priv: "*.*:ALL,GRANT"
                      with_items:
                        - "{{ ansible_hostname }}"
                        - 127.0.0.1
                        - ::1
                        - localhost 
                  

                  (編輯-刪除了 my.cnf)

                  (edit- removed my.cnf)

                  這篇關(guān)于在 ubuntu 上使用 ansible 安裝 MySQL的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產(chǎn)品、類別和元數(shù)據(jù)的 SQL 查詢 woocommerce/wordpress)
                  How to use MySQL in WSL (Windows Subsystem for Linux)?(如何在 WSL(Linux 的 Windows 子系統(tǒng))中使用 MySQL?)
                  PowerShell MySQL Backup Script Error in Task Scheduler 0x00041301(任務(wù)計(jì)劃程序中的 PowerShell MySQL 備份腳本錯(cuò)誤 0x00041301)
                  Import the data from the XML files into a MySQL database(將數(shù)據(jù)從 XML 文件導(dǎo)入 MySQL 數(shù)據(jù)庫(kù))
                  installed Xampp on Windows 7 32-bit. Errors when starting(在 Windows 7 32 位上安裝 Xampp.啟動(dòng)時(shí)的錯(cuò)誤)
                  Mysql lower case table on Windows xampp(Windows xampp 上的 Mysql 小寫表)
                    <tbody id='OF0Kv'></tbody>

                  <legend id='OF0Kv'><style id='OF0Kv'><dir id='OF0Kv'><q id='OF0Kv'></q></dir></style></legend>

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

                        <tfoot id='OF0Kv'></tfoot>
                          <bdo id='OF0Kv'></bdo><ul id='OF0Kv'></ul>
                          • <i id='OF0Kv'><tr id='OF0Kv'><dt id='OF0Kv'><q id='OF0Kv'><span id='OF0Kv'><b id='OF0Kv'><form id='OF0Kv'><ins id='OF0Kv'></ins><ul id='OF0Kv'></ul><sub id='OF0Kv'></sub></form><legend id='OF0Kv'></legend><bdo id='OF0Kv'><pre id='OF0Kv'><center id='OF0Kv'></center></pre></bdo></b><th id='OF0Kv'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OF0Kv'><tfoot id='OF0Kv'></tfoot><dl id='OF0Kv'><fieldset id='OF0Kv'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 一区二区三区精品 | 91精品国产91久久久久游泳池 | 亚洲一区在线观看视频 | 日韩视频一区二区 | 九九热这里只有精品在线观看 | 精精精精xxxx免费视频 | 精品国产乱码久久久久久88av | 91在线视频观看免费 | 久久国产精品99久久久大便 | 久久一起草 | 免费的色网站 | 99久久亚洲 | 午夜电影福利 | 久久小视频 | 亚洲中午字幕 | 久久精品一区 | 激情视频一区 | 欧美激情va永久在线播放 | 国产精品日日做人人爱 | 四虎在线播放 | 欧美在线观看免费观看视频 | 久久国产精品免费一区二区三区 | 国产成人亚洲精品自产在线 | 国产欧美日韩精品一区 | 日韩视频中文字幕 | 中文字幕av亚洲精品一部二部 | 日韩一区二区在线视频 | 一二区成人影院电影网 | 午夜成人在线视频 | 久久久国产精品一区 | 激情网五月天 | 欧美操操操 | 日韩视频一区二区在线 | 亚洲欧美一区二区三区在线 | 欧美在线a| 精品国产黄a∨片高清在线 www.一级片 国产欧美日韩综合精品一区二区 | 欧美国产免费 | 天堂在线网 | 欧美一级视频免费看 | 国产成人精品一区二区三区四区 | 日韩精品一区二区三区中文在线 |