Export/Import/Create database with exact character set (eg. utf8)

Hello,

A short article,

1. Export database with exact character set (eg. utf8)
$mysqldump -uUSERNAME -pPASSWORD --default-character-set=utf8 USER_DATABASE > backup.sql

2. Import database with exact character set (eg. utf8)
#mysql -uUSERNAME -pPASSWORD --default-character-set=utf8 USER_DATABASE < backup.sql

3. Create database with exact character set (eg. utf8)
$mysql -uroot -p
...
mysql> CREATE DATABASE mydb CHARACTER SET utf8;
 

Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

0 nhận xét:

Post a Comment