Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Database separation

2025-03-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Database separation:

On web:

Cd / home/oldboy/tools/

Export the wordpress database on web01 and package it

Mysqldump-uroot-poldboy123 wordpress-B | gzip > bak.sql.gz

Copy to database server

Scp bak.sql.gz root@10.0.0.51:/tmp

Db01:

Cd / tmp

Extract the copied database package

Gzip-d bak.sql.gz

Import the database package on web01 into the database

Mysql-uroot-poldboy123 flush privileges

Web01:

Shut down web01's database.

/ etc/init.d/mysqld stop

Prohibit boot self-startup

Chkconfig mysqld off

Cd / application/nginx/html/blog/

Change line 32 of the configuration file of web01 to the ip of the database server

Vim wp-config.php

Change the localhost on line 32 to the address of db01 172.16.1.51

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report