To take export / backup of mysql DB, use following command
>mysqldump -u <db_username> -p<db_password> -h<db_host> db_name > db_name_backup.sql
To take export / backup of table in mysql DB, use following command
>mysqldump -u <db_username> -p<db_password> -h<db_host> table_name > table_name_backup.sql
Similarly To import or dump the data into mysql database use following command
>mysql -u <db_username> -p<db_password> -h<db_host> db_name < ~/db_name_backup.sql (ensure db_name_backup.sql present in home directory)
>mysqldump -u <db_username> -p<db_password> -h<db_host> db_name > db_name_backup.sql
To take export / backup of table in mysql DB, use following command
>mysqldump -u <db_username> -p<db_password> -h<db_host> table_name > table_name_backup.sql
Similarly To import or dump the data into mysql database use following command
>mysql -u <db_username> -p<db_password> -h<db_host> db_name < ~/db_name_backup.sql (ensure db_name_backup.sql present in home directory)
No comments :
Post a Comment