Re: generating a mysql script
| From: | Brian V Bonini | Date: | Tue, 21 Sep 2004 00:41:25 +0000 |
| Subject: | Re: generating a mysql script | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197369@lists.php.net to get a copy of this message | ||
On Mon, 2004-09-20 at 19:37, Stut wrote:
> On Mon, 20 Sep 2004 16:20:21 -0700, AMC <aboehme@netgate.net> wrote:
> > Is there a tool that will generate a script that can be run to rebuild a
> > mysql database? I need to move my database to a different server
No need to use PHP which also makes this OT but...
Dump the data to a compressed file:
shell> mysqldump --quick db_name | gzip > db_name.contents.gz
Load it up into new machines db.
shell> mysqladmin create db_name
shell> gunzip < db_name.contents.gz | mysql db_name
You could also directly transfer it:
shell> mysqladmin -h 'other hostname' create db_name
shell> mysqldump --opt db_name \
| mysql -h 'other hostname' db_name