...
To export MySQL database:
Code Block |
---|
mysqldump -P 3306 -h [ip_address] -u [uname] -p[pass] |
--routines db_name > db_backup.sql |
Note: Mentioning port is optional if default 3306 is used and mentioning host is optional if host is localhost.
...
To import MySQL database:
Code Block |
---|
mysql -u [uname] -p[pass] -h [ip_address] db_name < db_backup.sql |
Note: Mention the full path of the backup file if it's not in the same folder as the folder from where command is run.