Richard Korts
asked on
Dumping a MySQL datavase with php
I'm looking for a way to move a MySQL database from one web derver to another.
Through a Google search I found MySQL Dump Class. It looks like it might work, but the example (as follows) is TOTALLY confusing. I want to save the dumped database to a file that I can ftp to my local machine & upload to a new host.
This "example" script seems like it "prints" the dump? Why on earth do that? Also, there is no reference to "mydb". What is that?
<?php
mysql_connect("localhost", "root", "");
require("class_mysqldump.p hp");
$dump = new MySQLDump();
print $dump->dumpDatabase("mydb" );
?>
Can someone help me understand this example script or point me to another way? I want to dump the MySQL database to a file. I ONLY have ftp access & the current web host is uncooperative. I DO NO have general command line access at the server so I don't think I can use MySQL Dump.
Thanks
Through a Google search I found MySQL Dump Class. It looks like it might work, but the example (as follows) is TOTALLY confusing. I want to save the dumped database to a file that I can ftp to my local machine & upload to a new host.
This "example" script seems like it "prints" the dump? Why on earth do that? Also, there is no reference to "mydb". What is that?
<?php
mysql_connect("localhost",
require("class_mysqldump.p
$dump = new MySQLDump();
print $dump->dumpDatabase("mydb"
?>
Can someone help me understand this example script or point me to another way? I want to dump the MySQL database to a file. I ONLY have ftp access & the current web host is uncooperative. I DO NO have general command line access at the server so I don't think I can use MySQL Dump.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worked like a charm!
Thanks,
Rkorts