Skip to content

Instantly share code, notes, and snippets.

@codeprimate
Last active August 29, 2015 14:24
Show Gist options
  • Save codeprimate/e46b1d308b293768651c to your computer and use it in GitHub Desktop.
Save codeprimate/e46b1d308b293768651c to your computer and use it in GitHub Desktop.
Export MySQL Data retaining character set
# Export
mysqldump --result-file=/data/output.sql --default-character-set=latin1 -ec -uUSERNAME -pPASSWORD -h localhost DATABASENAME
# Load
mysql
# > use databasename;
## Optional vvv
# > set names latin1;
# > source /path/to/dump.sql;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment