https://www.siteground.com/kb/importexport_mysql_database/

Exporting your database with the correct charset is important in order to avoid problems with data that has non-english characters.

For example, if the character set of your data is Unicode (UTF8) you can use the following command to export it using this charset:

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

Replace USERNAME, PASSWORD and USER_DATABASE with the appropriate values for your database and you will have a file named "backup.sql" properly encoded in UTF-8.

When you import backup into an empty MySQL database, you can set the exact character set for the data that will be inserted. To do this, use the following command:

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

Replace --default-character-set=utf8 with the charset used for the creation of the backup.sql file. This will ensure that your data is inserted correctly.

You need help managing your dedicated server? We got it! SiteGround experts not only write helpful articles, but also manage the servers for our clients so they don’t have to read articles like this one.Learn more.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to reboot your dedicated server via WHM?

The WHM panel provides two options for a server reboot: Forceful Server Reboot Graceful...

How to change the password for the root user via WHM?

In order to change the password for the root user you will need to access the WHM panel and...

How to access WHM?

WHM stands for Web Host Manager. This is the cPanel's server administrative management software....

How to restart a service on my dedicated server?

In order to restart a service on your dedicated machine, follow these steps: Log in your WHM...

How to edit the MX records of a domain on my dedicated server via WHM?

In order to edit an MX record of a domain on your dedicated server, follow these steps: Log in...