I have developed a PHP/MySQL driven website, and I want the site administrator to be able to back the db up when they want. It's all running on a hosting service.
The solution I came up with was when the administrator requests a backup:
1) create a new directory with name=timestamp
2) for each table, use a mysql "BACKUP TABLE" statement to export the table into the new directory.
Step 1 works fine, but step 2 fails with error 1045, Access denied for user: 'user_name@localhost' (Using password: YES).
Extra info:
- I've not GRANTed anything in the database
- INSERT/UPDATE/DELETE/SELECT works fine
- the newly created directory is chmod'ed to 0777
Anyone used this backup method before? (and got it to work!).
One more question ... is the path in the BACKUP statement absolute or relative? (and if relative, relative to what - the php script location?)
tia
The solution I came up with was when the administrator requests a backup:
1) create a new directory with name=timestamp
2) for each table, use a mysql "BACKUP TABLE" statement to export the table into the new directory.
Step 1 works fine, but step 2 fails with error 1045, Access denied for user: 'user_name@localhost' (Using password: YES).
Extra info:
- I've not GRANTed anything in the database
- INSERT/UPDATE/DELETE/SELECT works fine
- the newly created directory is chmod'ed to 0777
Anyone used this backup method before? (and got it to work!).
One more question ... is the path in the BACKUP statement absolute or relative? (and if relative, relative to what - the php script location?)
tia