Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  Dedicated Server FAQ  >  Importing / Exporting MySQL Database With The Exact Character Set On The Dedicated Server
Top Scroll

Importing / Exporting MySQL Database With The Exact Character Set On The Dedicated Server

 2 min

In order to avoid issues with the data that contains non-english characters, exact character set has to be used for importing the MySQL database.

For instance, if Unicode (UTFB) is the character set of your data, the following command can be used for importing the character set:

mysqldump -uUSERNAME -pPASSWORD –default-character-set=utf8 USER_DATABASE > backup.sql

The attributes – USERNAME, PASSWORD and USER_DATABASE can be updated with the relevant values pertaining to your database and then a file “backup.sql” will be created that will be encoded in UTF-8.

If any empty MySQL database is used for importing the backup, the exact character set for the data can be inserted manually. You will have to use the following command for doing this:

mysql -uUSERNAME -pPASSWORD –default-character-set=utf8 USER_DATABASE < backup.sql

Replace –default-character-set=utf8 with the respective character set used for creating the backup.sql file for making sure that the data is inserted correctly.

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.