Hi,
I may change hosting company and I wonder what's the best way to retrieve my database contents.
I could somehow dump each record from each table to an HTML page (some fields are blobs) and read the url from my pc to rebuilt the database locally and check it.
Then upload it again, though I am unsure how, except as php files holding sql inserts.
Or read the URLs directly from my new host.
Do such download/upload example scripts exist?
Any better idea than using HTML pages to dump it and retreive it all?
Any security, data formatting, etc. isuue I should be careful about?
Thanks for your insight.
how to download mysql database contents?
Moderator: General Moderators
If you have shell access to your new host and your account are able to connect from other than localhost I would have done this:
That's it.
If you have access to phpmyadmin i belive there's some functionallity to dump tables and data into a flat html file.
Code: Select all
# mysqladmin create database
# mysqldump -h old.host.com -u userold name -p database | mysql -u usernew -p databaseIf you have access to phpmyadmin i belive there's some functionallity to dump tables and data into a flat html file.
Well, if no phpMyAdmin (and you shouldn't learn to realy on it anyways), but you can at least ssh to your acouunt (Telnet? Egads! Horrors!), do this.
To dump it to a file type in
That will dump the schema and all data to the file. When it's on your new server,
and the database has been created, type in...
.... and you're off to the races.
Later on,
BDKR
To dump it to a file type in
Code: Select all
mysqldump databasename > databasename.sqland the database has been created, type in...
Code: Select all
mysql databasename < databasename.sqlLater on,
BDKR
Thank you.
Thank you to all of you people.
I have to try that now.
I'll come back if I need more help, but all the stuff you have given me looks great!
I have to try that now.
I'll come back if I need more help, but all the stuff you have given me looks great!