How to import and Export large Database in MySql using command line?

How to import and Export large DB in MySql using command line mysqldump?

You just need to login to your server where mysql is installed and start using below commands. It is very easy and capable to export and import huge databases quickly.

Export Database:
    mysqldump -h localhost -u root -p database_name > export_file.sql

Export Database and Exclude Some tables:
    mysqldump -h localhost -P 3306 -u root -p --ignore-table=table1 --ignore-table=table2 database_name > export_file.sql

Import Database:
    mysql -h localhost -u root -p database_name < export_file.sql

To login in Database and perform some query like you do using phpmyadmin or any other sql client software:
    sudo mysql -u root -p -h localhost
    show databases;
    use database_name;
    show tables;
    SELECT * FROM table_name;