PDA

View Full Version : MySQL Database Backup Problem


Deaths
02-22-2005, 04:33 PM
I'm changing hosts, but to change hosts, I ofcourse need to save my database, then re-upload it.

The problem is, is that when I download the .sql file, and I upload it to my new host using phhMyAdmin, it first adds all the tables and fields, and then says the database is empty...
So, it basicly deletes itself again...

Does anyone know what to do?
I tried copy-pasting the content of the .sql file, but it's way too big :(.

Help would be appreciated.

tnguy3n
02-22-2005, 05:04 PM
if you have shell access on new host. Use this following command:
mysql -u username -p vbforumdb < /home/path/to/db.sql
of course, you must have your database uploaded to the new server.

Deaths
02-22-2005, 05:09 PM
Thanks, I'll try it.

The problem might be that I'm importing from a Cpanel host, to a Confixx Pro host. (Name problems).

Marco van Herwaarden
02-23-2005, 02:30 AM
Are you sure that your backup contain both structure and DATA?

You could check this quickly by looking into the sql file with an editor, or by checking the filesize.

Deaths
02-23-2005, 11:01 AM
Filesize: 13.7 MB.

Stats:
Members: 25
Threads: 183
Posts: 1,302

I think that's the full DB...
I've downloaded the backup using the vB backup system now, I'll check if that one works.

Michael Morris
02-23-2005, 11:27 AM
For a database that small you can use mysql dump to move the data from one machine to the new. Just make sure the old machine will allow a root connection from the new.

Get both machines online at the same time and figure out their IP's, then type this command on the old machine


mysqldump --opt db_name | mysql --host=remote_host -C db_name

You will probably need to use the --user and --password switches on both servers in the command to log in.

mysqldump --user --password db_name | mysql --host=remote_host --user --password -C db_name

So, for example

mysqldump --user=root --password=YeahRightImShowingYouMyPassword testdb | mysql --host=0.0.0.0 --user=root --password=AsAbove -C testdbonnewserver

R@ptor
02-24-2005, 10:34 AM
When I use the "restore My SQL" in the cpanel mine does the same thing....
My only problem is I'm not familiar with "shell access"....
I D/L my DB to my home PC as well as a copy of my home dir.

Maybe I did everything wrong.... but I too am moving from one provider to another.
Here is what I did:
I dowloaded a back up of my sql and home dir to my home PC via Cpanel-
Then I loaded a fresh install of VB on my new host -
I then tried to retore mysql....but no go- I'm stuck

When I too use the "resore my sql" feature it tells me the file is empty and does nothing......
Can someone point me in the right direction....my time on my current provider is running out...FAST.

I forgot to add my DB is 160Mb