Import database through the SSH
For Importing the database through the SSH
Step 1. Open the terminal.
Step 2. Login through the SSH
ssh {user_name}@{host_name}
Step 3. Press Enter then it will ask for the Password after entering the Password you will be logged in.
Step 4.
mysql -u {database_username} -p {database_name} < filename.sql
Enter the Database User Name and the Database Name and the filename and press Enter then it will ask for the Password after putting the Password it will Import the database.
Export database through the SSH
For Exporting the Database use the below command
mysqldump -u {database_username} -p {database_name} > filename.sql
Enter the Database User Name and the Database Name and the filename and press Enter then it will ask for the Password after putting the Password it will Export the database.
Export only one database table through the SSH
For Exporting only the one database table use the below command:
mysqldump -u {database_username} -p {database_name} --tables {database_tablename} > dumpfile.sql
Specify the Database User Name, Database name and database table which you want to Export.
Hope this will help to someone. Enjoy the working on the SSH.