[root@ufuso ~]# /bin/cp -Rf /mnt/usbhd/all/backup/var/lib/mysql/life /var/lib/mysql/
← 復元(wordpressのデータベースをlifeとする)
[root@ufuso ~]# chown -R mysql:mysql /var/lib/mysql/life/ ← 所有者をmysqlに
変更
[root@ufuso ~]# chmod 700 /var/lib/mysql/life/ ← 所有者のみに書込み許可
[root@ufuso ~]# chmod 660 /var/lib/mysql/life/* ← 所有者・グループに書込み許可
[root@ufuso ~]# mysql -u root -p ← mysqlの起動
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 445
Server version: 5.1.69 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> grant all privileges on life.* to tu@localhost identified by 'tuのパスワード';
← 管理者(例示ではtu)の復元
Query OK, 0 rows affected (0.00 sec)
mysql> exit ← mysqlの終了
Bye
[root@ufuso ~]# yum install php-mysql ← phpでmysqlを使うために必要
Installed:
php-mysql-5.3.3-22.el6.x86_64
Dependency Installed:
php-pdo-5.3.3-22.el6.x86_64
Complete!
[root@ufuso ~]# /etc/init.d/httpd restart ← WEBサーバー再起動
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]