(Q2) But the total size of the dump is 483MB when checking out the file's properties using WinSCP. Is the backup truly complete?
(Q3) On a side note, am I doing the right thing by downloading the dump in binary? Or should this be done in ASCII? (I dragged the file onto my desktop using WinSCP and it started a binary transfer)
Express Hosting
"We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
A database dump is not going to the same size as the database.
the database is a file or files that the database creates, in it's own format, to store the data.
A data dump is most certainly not that.
open the dump and read it. the first few lines describe a table, the next lines are composed of insert statements.
the sql dump file instructs mysql on how to create the table and insert the data, it is not an actual data file that the data base can use. It is nothing more than a file that the database would use to reconstruct from, but not to operate from.
Also remember that indices take space. A dump has no indices. Another thing to think about..... when you delete something from the database the database doesn't shrink. It does not give up that space. If you delete the equivalent of 100 megs of data out of the database it still doesn't shrink. Think about it, if you delete something that's in the middle of the table why would you want mysql to rewrite everything behind it in the table in order to regain that space?
That's what optimize does. Even if you do optimize your database the sql dump will nto be the same size as the actual mysql data table. They are apples and oranges.
Can you dump a table individually? Yes, read the documentation on mysql.com for the syntax.
_________________________
This thread for sale. Click here!
OK, since the db/dump size is not going to be identical then I will assume that the server is giving me a complete backup.
If I dump the DB as instructed earlier in this thread (into a single file) then that's all I need to restore my database should anything bad happen, right? It'll restore all those tables from that single file?
What's the case with indeces? If the dump doesn't contain them, then what happens if I restore a DB using a dump? I get everything but the indexes? Could that pose a problem? Does the Admin CP backup copy the indeces if you do a backup that way?
Oh, and I still can't believe that what used to take 10+ hours now takes under 30 seconds. It just seems that having command line access to the server makes an incredible difference. 10 hours or 30 secs... it's just unreal.
Registered: 06/05/06
Posts: 15455
Loc: Portland, OR; USA
Originally Posted By: Conrad
If I dump the DB as instructed earlier in this thread (into a single file) then that's all I need to restore my database should anything bad happen, right? It'll restore all those tables from that single file?
You are correct, you would use the following syntax to insert the tables into the database: mysql -h localhost -uusername -ppassword database_name < dump_name.dump
And yes, I love using ssh to do all of my work on a server, it just saves time being able to edit files, create and upload dumps, etc.
command line access makes many tasks a heck of a lot easier. It also makes it easier to make a fatal mistake. Do take care when you log in via command line.
The indices are created when the table is created, and populated as the data is inserted, just like when the database is functioning normally.
_________________________
This thread for sale. Click here!