07 Jun, 2008
Utf-8 encoding problem with MySQL restore
Web Development » Troubleshooting » Utf-8 encoding problem with MySQL restore
To resolve Utf-8 encoding problem that you experience when you restore a MySQL database, here is a quick and easy fix.
You will first need to make sure that appropriate encoding/collation (eg: utf8_bin, latin1_swedish_ci, etc) is being used for your database and tables before you attempt the following steps.
1. Open your MySQL dump file in a text editor (eg: Notepad++)
2. Add <meta http-equiv="content-type" content="text/html;charset=utf-8"> at the beginning of the file
3. Save the file as “mysqldump.html”
4. Open mysqldump.html in a web browser (I use Firefox)
5. View source of the file (Shortcut in Firefox: Ctrl+U), and copy the entire content except for the first line <meta http-equiv="content-type" content="text/html;charset=utf-8">
6. Paste it into MySQL query window of your new database (You can use phpMyAdmin’s Query Window) and run the queries
Technorati Tags: mysql, database, restore, utf8, encoding, unicode
Other similiar posts that you might be interested in:
- Framebar (like diggbar) example in html and css with no javascript
- Code to embed Google Map and Street View
- Display a download dialog for pdf in PHP
- 15 tips on optimising MySQL databases and MySQL queries
- Sun acquired MySQL for $1 billion
- Click to copy and open site script
- Backuping and restoring a single table using mysqldump






