nephish is right. You can dump an entire database using mysqldump. This command will dump the entire structure and contents of the "databasename" database on the local machine to a file called backup.sql (the -p option will prompt you for your password):
Code:
mysqldump -u mylogin -p databasename > backup.sql
You can also dump the data from a remote server (if you have permission to access it from your host):
Code:
mysqldump -u mylogin -p --quick -h database.server.com databasename > backup.sql
To get the backed up database onto the new machine, first create the database:
Code:
mysqladmin -p create databasename
And then do the magic to bring the structure and data back:
Code:
mysql -u mylogin -p databasename < backup.sql
Hope that helps.
Håkan