1.3版新功能html
- MySQLdb的
參數 | 須要 | 默認 | 選擇 | 註釋 |
---|---|---|---|---|
CONFIG_FILE
(2.0 加入)
|
no | 〜/ .my.cnf |
指定要從中讀取用戶和密碼的配置文件。
|
|
connect_timeout
(2.1 加入)
|
no | 30 |
鏈接到MySQL服務器時的鏈接超時。
|
|
login_host |
no | localhost |
主機運行數據庫。
|
|
login_password |
no |
用於驗證的密碼。
|
||
login_port |
no | 3306 |
MySQL服務器端口。若是使用login_port,則須要將
login_host
定義爲其餘本地主機。
|
|
login_unix_socket |
no |
到本地鏈接的Unix域套接字的路徑。
|
||
login_user |
no |
用於驗證的用戶名。
|
||
master_auto_position
(2.0 加入)
|
no |
主機是否使用基於GTID的複製
|
||
master_connect_retry |
no |
和mysql變量同樣
|
||
MASTER_HOST |
no |
和mysql變量同樣
|
||
MASTER_LOG_FILE |
no |
和mysql變量同樣
|
||
MASTER_LOG_POS |
no |
和mysql變量同樣
|
||
MASTER_PASSWORD |
no |
和mysql變量同樣
|
||
MASTER_PORT |
no |
和mysql變量同樣
|
||
master_ssl |
no |
|
和mysql變量同樣
|
|
master_ssl_ca |
no |
和mysql變量同樣
|
||
master_ssl_capath |
no |
和mysql變量同樣
|
||
master_ssl_cert |
no |
和mysql變量同樣
|
||
master_ssl_cipher |
no |
和mysql變量同樣
|
||
master_ssl_key |
no |
和mysql變量同樣
|
||
MASTER_USER |
no |
和mysql變量同樣
|
||
mode | no | getslave |
|
module operating mode. Could be getslave (SHOW SLAVE STATUS), getmaster (SHOW MASTER STATUS), changemaster (CHANGE MASTER TO), startslave (START SLAVE), stopslave (STOP SLAVE), resetslave (RESET SLAVE), resetslaveall (RESET SLAVE ALL)
|
RELAY_LOG_FILE |
no |
和mysql變量同樣
|
||
RELAY_LOG_POS |
no |
和mysql變量同樣
|
||
ssl_ca
(加入2.0)
|
no |
證書頒發機構(CA)證書的路徑。此選項(若是使用)必須指定與服務器使用的相同的證書。
|
||
ssl_cert
(加入2.0)
|
no |
客戶端公鑰證書的路徑。
|
||
ssl_key
(加入2.0)
|
no |
客戶端私鑰的路徑。
|
# Stop mysql slave thread - mysql_replication: mode: stopslave # Get master binlog file name and binlog position - mysql_replication: mode: getmaster # Change master to master server 192.0.2.1 and use binary log 'mysql-bin.000009' with position 4578 - mysql_replication: mode: changemaster master_host: 192.0.2.1 master_log_file: mysql-bin.000009 master_log_pos: 4578 # Check slave status using port 3308 - mysql_replication: mode: getslave login_host: ansible.example.com login_port: 3308
注意python
該模塊被標記爲預覽,這意味着它不能保證具備向後兼容的界面。mysql