Header Ads

Export and import dump database in MySQL with command line

Export and import dump database in MySQL with command line


Export and import dump database in mysql command line



Export dump database in mysql with command line



mysqldump -u username -p database_name > data-dump.sql

  1. username is the username you can log in to the database with
  2. database_name is the name of the database that will be exported
  3. data-dump.sql is the file in the current directory that the output will be


Import dump database in mysql with command line



mysql -u username -p new_database < data-dump.sql


Note: You must create database before import



No comments