您的位置:首页 > 数据库 > MySQL

Ansible实用案例之批量重装mysql

2017-08-21 00:14 288 查看
ansible all -m command -a "service mysqld stop"

ansible all -m file -a "dest=/home/mysql state=absent"

ansible all -m file -a "dest=/home/mysql_ex state=absent"

ansible all -m file -a "dest=/home/mysql state=directory"

ansible all -m file -a "dest=/home/mysql/data state=directory"

ansible all -m file -a "dest=/home/mysql/log state=directory"

ansible all -m command -a "chown mysql: -R /home/mysql/"

ansible all -m command -a "mysql_install_db --datadir=/home/mysql/data/ --user=mysql"

ansible all -m command -a "service mysqld start"

ansible all -m command -a "cat /root/.mysql_secret"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: