How to export/import MySQL database with correct character set on Dedicated server?
To Export/Import MySQL database with correct list on dedicated server export your database with the right set is very important so as to avoid any quite issues with data that has non english characters within the table.
For example, if the list of your data is Unicode (UTF8) you’ll be able to use the subsequent command to export it using this character set:
Below is the syntax for the command :
mysqldump -u UserName -p Password –default-character-set=utf8 User_Database > backup.sql
In the UserName, Password and User_Database field replace values for your database and you will have a file named “backup.sql” encoded in UTF-8.
When you import a database backup into an empty MySQL database tables then you’ll be able to set the exact character set for the data. For that use the subsequent syntax for the command is as follows,
mysql -uUserName -pPassword –default-character-set=utf8 User_Database < backup.sql
Restore –default-character-set=utf8 by using the charset for the creation of the backup.sql file. Make sure that your inserted data is properly managed and inserted correctly.