*@Web01*
mysqldump -uroot -pcentos -A > all.sql
scp all.sql root@192.168.99.101:/root/.
*@DB01*
mysql -uroot -psziit < all.sql
mysql -uroot -psziit -e "show databases;"
2.3 配置Wordpress使用新的数据库服务器
a) 防火墙放行mysql端口
@DB01
firewall-cmd --add-service=mysql
firewall-cmd --add-service=mysql rmanent
b) Selinux允许http网络连接
@Web01
setsebool -P httpd_can_network_connect on
c) 创建数据库用户并对Wordpress数据库授权
mysql -uroot -pcentos
MariaDB [(none)]> grant all on wordpress.* to 'wordpress'@'192.168.99.%' identified by 'centos';
MariaDB [(none)]> flush privileges;
d) 修改wp-config.php指向新的数据库服务器
vim /var/www/html/wp-config.php
/** The nam