i use this command to make mysqldump from the old server
mysqldump -h localhost -u [MySQL user, e.g. root] -p[database password] -c --add-drop-table --add-locks --all --quick --lock-tables [name of the database] > sqldump.sql


and i use this command to dump the data into the new server
mysql -h localhost -u [MySQL user, e.g. root] -p[database password] [name of the database] < [name of your sql dump, e.g. sqldump.sql]


so using the above i can give you and example.

user: root
password: mypass
dbname: mydata
name of sql dump: mydump.sql

NEW SERVER:
mysqldump -h localhost -u root -pmypass -c --add-drop-table --add-locks --all --quick --lock-tables mydata > mydump.sql


OLD SERVER:
mysql -h localhost -u root -pmypass mydata < mydump.sql


done