安装环境
yum install mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
推送至数据库服务器
[root@web01 ~]
推送
[root@web01 ~]
数据库服务器恢复数据
[root@db ~]
[root@db ~]
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
| wordpress |
| zh |
+--------------------+
6 rows in set (0.00 sec)
重启数据库服务器
[root@db ~]
[root@db ~]
创建远程连接用户
MariaDB [(none)]> grant all privileges on *.* to 'all'@'%' identified by '123456';
测试
[root@7 ~]
Welcome to the MariaDB monitor. Commands end with ; or \g.
MariaDB [(none)]> quit
停止本地数据库
[root@web01 ~]
[root@web01 ~]
修改wordpress连接数据库的信息
[root@web01 wordpress]
/** WordPress数据库的名称 */
define( 'DB_NAME', 'wordpress' );
/** MySQL数据库用户名 */
define( 'DB_USER', 'all' );
/** MySQL数据库密码 */
define( 'DB_PASSWORD', '123456' );
/** MySQL主机 */
define( 'DB_HOST', '192.168.1.7' );