Export the complete database using mysqldump :

    $ mysqldump -u -h -p    >
Import the complete database using mysqldump :

  $ mysqldump -u -h -p   
Usuage :
-u   :for database username
    -h  : To specify the database server IP
    -p  : To specify password
     : Name of the exported file.
     : Name of the database which need to extract.

Example :

   $ mysqldump -u root -p test > test.sql
    [In this case database server at localhost]