Gurjit Singh Dhillon
January 29th, 2007, 07:55 AM
Hi,
i have found the ownership problem if i restore the backup,
following are the steps i have done.
1) created a database office1
2) created a table employee_data under database office1
3) taken backup of database office1
mysql-zrm-scheduler --now --backup-set office1 --backup-level 0
The result was successfull
4) verified the same backup,
5) droped the database office1
6) restore the database office1 from backup.
mysql-zrm --action restore --backup-set office1 --source-directory /var/lib/mysql-zrm/office1/20070129101608/
which was also successfull.
7) check the database in mysql again, which was correct.
8) check the table under the database office1, where i have found error.
the error is below,
[root@dev0 mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.27-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use office1
Database changed
mysql> show tables;
ERROR 1018: Can't read dir of './office1/' (errno: 13)
mysql> check table employee_data;
+-----------------------+-------+----------+------------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-----------------------+-------+----------+------------------------------------------------------------+
| office1.employee_data | check | error | Can't find file: './office1/employee_data.frm' (errno: 13) |
+-----------------------+-------+----------+------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select * from employee_data;
ERROR 1017: Can't find file: './office1/employee_data.frm' (errno: 13)
i have found here, there is ownership problem whenever i restore the database,
[root@dev0 mysql]# ls -ld /var/lib/mysql/office1
drwxr-x--- 2 root root 4096 Jan 29 10:18 office1
the ownership of the database comes to root, if i change the ownership from root to mysql manually, and found it works, now i was able to see the tables also under mysql console.
can anyone tell me how i can preserve or keep the ownership after taking the restore backup of mysql.
i have found the ownership problem if i restore the backup,
following are the steps i have done.
1) created a database office1
2) created a table employee_data under database office1
3) taken backup of database office1
mysql-zrm-scheduler --now --backup-set office1 --backup-level 0
The result was successfull
4) verified the same backup,
5) droped the database office1
6) restore the database office1 from backup.
mysql-zrm --action restore --backup-set office1 --source-directory /var/lib/mysql-zrm/office1/20070129101608/
which was also successfull.
7) check the database in mysql again, which was correct.
8) check the table under the database office1, where i have found error.
the error is below,
[root@dev0 mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.27-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use office1
Database changed
mysql> show tables;
ERROR 1018: Can't read dir of './office1/' (errno: 13)
mysql> check table employee_data;
+-----------------------+-------+----------+------------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-----------------------+-------+----------+------------------------------------------------------------+
| office1.employee_data | check | error | Can't find file: './office1/employee_data.frm' (errno: 13) |
+-----------------------+-------+----------+------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select * from employee_data;
ERROR 1017: Can't find file: './office1/employee_data.frm' (errno: 13)
i have found here, there is ownership problem whenever i restore the database,
[root@dev0 mysql]# ls -ld /var/lib/mysql/office1
drwxr-x--- 2 root root 4096 Jan 29 10:18 office1
the ownership of the database comes to root, if i change the ownership from root to mysql manually, and found it works, now i was able to see the tables also under mysql console.
can anyone tell me how i can preserve or keep the ownership after taking the restore backup of mysql.