新主机上安裝好LAMP
console 連入mariadb
#mysql -u root -p
>create database sfs3;
>GRANT ALL PRIVILEGES ON sfs3.* TO 'sfs3man'@'localhost' IDENTIFIED BY 'PASSWORD';
>use mysql; 觀察mysql.user
>describe mysql.user;
>select user from mysql.user;
更新密碼
>update user set password=PASSWORD("NEW_PASSWORD") where User='sfs3man';
> flush privileges;
> exit
以sfs3man連入mariadb 看看吧...
RESTORE to new machine
將/var/www/html/sfs3 打包及dump出來的sfs3db.sql 一起上傳到新机器
sfs3.tar.gz 解壓到/var/www/html
#tar zxvf sfs3.tar.gz -C /var/www/html/
chown -R apache:apache /var/www/html/sfs3
chmod 644 /var/www/html/sfs3/include/config.php
chown root.root /var/www/html/sfs3/include/config.php
讓config.php 為唯讀且屬root
chmod -R 777 /var/www/html/sfs3/data/
更改include/config.php的ip 為新机的
mysql -u root -p sfs3 < sfs3db.sql
console 連入mariadb
#mysql -u root -p
>create database sfs3;
>GRANT ALL PRIVILEGES ON sfs3.* TO 'sfs3man'@'localhost' IDENTIFIED BY 'PASSWORD';
>use mysql; 觀察mysql.user
>describe mysql.user;
>select user from mysql.user;
更新密碼
>update user set password=PASSWORD("NEW_PASSWORD") where User='sfs3man';
> flush privileges;
> exit
以sfs3man連入mariadb 看看吧...
RESTORE to new machine
將/var/www/html/sfs3 打包及dump出來的sfs3db.sql 一起上傳到新机器
sfs3.tar.gz 解壓到/var/www/html
#tar zxvf sfs3.tar.gz -C /var/www/html/
chown -R apache:apache /var/www/html/sfs3
chmod 644 /var/www/html/sfs3/include/config.php
chown root.root /var/www/html/sfs3/include/config.php
讓config.php 為唯讀且屬root
chmod -R 777 /var/www/html/sfs3/data/
更改include/config.php的ip 為新机的
mysql -u root -p sfs3 < sfs3db.sql
沒有留言:
張貼留言