PDA

View Full Version : Backing up MySql database


ComandoSupremo
4-16-03, 02:03 PM
I am getting the error code below when I try to back up my database for my phpBB2 board at www.comandosupremo.com. I am on jupiter.powweb.com. Any idea what may be causing it?

500 Internal Server Error
--------------------------------------------------------------------------------
There has been an error in processing your request. Please contact support@powweb.com with a brief description of your problem and what you were doing at the time.
--------------------------------------------------------------------------------


PowWeb Hosting WebMasters
--------------------------------------------------------------------------------

Webmasters, if you are having problems getting CGI, SSI or PHP scripts to work or need additional information such as paths to popular programs, please check the following before contacting PowWeb Technical Support.


Please check your error_log in your logs directory. If you do not have an error_log, please make sure logging is enabled for your website.
Please consult our CGI/SSI and PHP Category in Our Frequently Asked Questions.
Please make sure your script and directory pemissions are properly configuered as stated in our FAQ's.
If you do not want this Error Page, you can use the ErrorDocument redirect directive in your .htaccess file.

Sincerely,
PowWeb Development Staff

HalfaBee
4-16-03, 07:33 PM
Your DB has probably grown too big for the backup script and it is timing out.

You could put a php.ini in the directory the script is in and change the timeout value to 60secs.

Or you could use mysql-front on your pc to do the backup.

HalfaBee

notset4life
4-23-03, 03:14 PM
I have the same problem. EXACTLY, what should the contents of php.ini contain (how should it read?)

TIA
Vince

devinemke
4-23-03, 06:29 PM
read this:
http://support.powweb.com/tutorials/phpdotini.php

HalfaBee
4-23-03, 06:55 PM
Try changing this line
max_execution_time = 30 ; Maximum execution time of each script, in seconds

Try 60 to start with.

HalfaBee

notset4life
4-23-03, 08:52 PM
Thanks again. I keep raising it but still get the error.

One of my tables, which is hamed STATS
has over 70000 records. It is too
large and I wish to reduce it. That would solve
the problems.

Do you (or anyone) know the command to use in
a phpmyadmin sql query to delete x number of
records? for example, I would like to delete records older
than 3 months, and keep newer data...or anything
similar to that?

TIA
v

HalfaBee
4-23-03, 09:09 PM
Without knowing your table description this will be very generic.
You will need something like this

DELETE from yourtablename where entrydate < now() - INTERVAL 3 month

You should backup your database before doing this.

Try this little php script

<? system( '/usr/local/bin/mysqldump --opt --no-create-db -h yourhost -u youruser -p yourpasswd -r backup.sql yourDBname') ?>
Upload to htdocs and run this from the browser and it should be done.
You will see a file in htdocs called backup.sql which should contain all the sql to recreate your db.

[edit] added closing ' and )
yourhost should look like server.powweb.com or mysql01.powweb.com

HalfaBee

notset4life
4-23-03, 09:30 PM
I get parse errors,apparently something is not right with the script. Secondly, how should "yourhost"?

thanks again
v


---------------------
Try this little php script

<? system( '/usr/local/bin/mysqldump --opt --no-create-db -h yourhost -u youruser -p yourpasswd -r backup.sql yourDBname ?>
Upload to htdocs and run this from the browser and it should be done.
You will see a file in htdocs called backup.sql which should contain all the sql to recreate your db.


HalfaBee [/B][/QUOTE]

HalfaBee
4-23-03, 10:03 PM
It should look like this

<? system( '/usr/local/bin/mysqldump --opt --no-create-db -h yourhost -u youruser -p yourpasswd -r backup.sql yourDBname') ?>

HalfaBee ( Not quite with it today )

notset4life
4-23-03, 10:18 PM
Halfabee,
I certainly appreciate your time and effort, and quick responses.
It still doesn't work. I get a blank backup.sql file.
Sorry I'm such a bonehead, but what should be put in place of YOURHOST ?

V

HalfaBee
4-24-03, 06:22 AM
In place of yourhost should be server.powweb.com.

This is found in OPS in the mysql section.
Normally space.powweb.com or some other celestial name or mysql01.powweb.com for the new system.

HalfaBee

starlitedi
4-24-03, 08:41 AM
I have a Table with over 500,000 records. I use Mysql Front to backup my data bases. I have never had a problem backing up with this program.

Tim