MySQL – import / export database from / into file

Export database into a file with shell command:


mysqldump -u USERNAME -p PASSWORD database > filename.ext;

Import database from a file with shell command:


mysql -u USERNAME -p PASSWORD database < filename.ext;

Leave a Reply

Your email address will not be published. Required fields are marked *