Import/export MySQL in SSH

Export:

mysqldump -u USERNAME -p DATABASENAME > backupfile.sql

Import :

mysql -u USERNAME -p DATABASENAME  < backupfile.sql

Connect:

mysql -uusername -p DATABASENAME

Tags: ssh mysql