Use the mysqldump program to create a .sql file from your database, then use the mysql program to load it back in at the other end.
For maximum performance, do both of these operations locally on the two servers, and transfer the file (rather than running it on a remote machine).
Read the mysql documentation for more info.
Mark