Jump to content

How to backup mysql database through php?


jdock1

Recommended Posts

 

Thanks, but that shit sucks. I cant get it to work on my server

 

Anybody else got a solution? A simple one with a few lines of code. That script is alot of code for a relatively simple thing

I've read it's bad to use php and other web applications to backup mysql databases (for big sites).

 

If it timeouts the file becomes corrupt. Backing up via SSH seems more solid.

 

Backup via SSH:

 

mysqldump --opt -u user -p dbname > {path}/backup.sql

 

Restore via SSH:

 

mysql -u user -p dbname < {path}/backup.sql

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.