Wednesday, November 21 in 2018
LEPTON CMS

See also:

See also:

See also:

How to modify a database from ISO-XXXX to UTF-8

This article is written by erpe

 

The task

Since years the standard charset is moving from country-based charsets to standard charsetcode UTF-8. If you are forced to modify your database from iso to utf the following "howto" may help you. It is strongly recommended to backup your database before starting in case something is going wrong. Additionally please take care that noone is working on your database during setup. It is a good idea to block the whole site.

 

 

PHPMyAdmin

First a software is needed to work on your database. Normally phpMyAdmin is available on most webspaces.

Please call the URL to phpMyAdmin in your browser and login into your database. Then call the specific database.

before
  phpMyAdmin: this is how the db looks like
   

 

 

Export database

After database appears please use the tab "export" .

Having modified your settings for export please press button ok and the database in plain text should appear in your browser.

export
  phpMyAdmin: export settings
   

 

 

Edditor: search and replace

Mark the whole database by right click and copy all to your local favourite editor (for example notepad).

Use the function "search and replace" to modify all calls of DEFAULT CHARSET .

search
  Editor: search/replace of DEFAULT CHARSET
   

 

 

Delete tables

Return now to your database in phpMyAdmin and delete all tables of your database.

NOTICE: delete only tables, NOT the database itself.

delete
  phpMyAdmin: delete all tables
   

 

 

Modify database

phpMyAdmin: click on the tab "SQL" and modify the database using following call:

ALTER DATABASE `database_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

alter
  phpMyAdmin: modify database
   

 

 

Insert tables again

After success click again on the SQL Tab.

Copy & paste all modified tables from local editor into the sql window and click "ok".

sql
  phpMyAdmin: insert all tables
   

 

 

(nearly) done!

If inserting was successfull please click the database to see all tables.

The modified tables should look similar to that in the image on the right.

after
  phpMyAdmin: tables after inserting
   

 

 

At last

Please make sure that utf-8 is standard charset in the "settings/advanced settings". Have a look at the generated source code to see, if there are some notices about the old charset. Prove the frontend of your site/pages if there are any "wrong" signs.

Congratulation, you are done, utf-8 ist standard charset of you installation!

If there are any further questions try your favourite searchmachine....

 

 

Back


TagCloud