Hvernig til Umbreyta Stafasett og Nįkvęmur samanburšur af WordPress Gagnasafn

SķšanWordPress 2.2, WordPress styšja lögun žessi leyfa the notandi til śtskżra bįšir the WordPress gagnasafn stafasett og nįkvęmur samanburšur meš DB_CHARSET og DB_COLLATE gildi ķ wp-config.php skrį. Meš žessir gildi śtskżra, WordPress vilja nota the śtnefndur gagnasafn ešli ( vinna viš ręstingar) og gagnasafn nįkvęmur samanburšur (i.e. tegund dagskipun bréf, reikningur, og tįkn af a stafasett) hvenęr bullustöng a gagnasafn matskeiš.

Hvernig sem, ķ žaš sem til er WordPress embęttisvķgsla žessi ert uppfęrsla frį įšan śtgįfa af WordPress eša ekki skżr setja a Einhyrningur UTF-8 vinna viš ręstingar nįkvęmur samanburšur, the vanręksla gagnasafn stafasett er venjulega lįtast vera Latķna ( vanręksla į nęstum allur MySQL embęttisvķgsla) meš latin1_swedish_ci nįkvęmur samanburšur. Ef žś hlaupa a tvķtyngdur eša fjöltyngdur blog meš WordPress, žś mega andlit vandamįl į ešli umrita ķ dulmįl hvenęr žinn blog staša ert skrifašur ķ annar erlendur tungumįl, eša hvenęr žś śtflutningur og varabśnašur the gagnasafn og seinna tilraun til meš tilvķsun til- innflutningur the gagnasafn sorphaugur ķ the atburšur af gagnasafn bilun eša framreišslumašur flutningur og įhrifamikill. The einkenni er augljós, žinn WordPress staša eša blašsķša vilja innihalda rangfęra, furšulegur og hlęgilegur ešli, einhvern tķma réttlįtur hellingur af????? (spurning skytta), flutningur the WordPress gagnasafn meš žinn haršur vinna gagnslaus og framleišsla ólęsilegur. (mega orsök einnig višrangur vinna viš ręstingar nįkvęmur samanburšur)

The bestur lausn til the ešli umrita ķ dulmįl vandamįl ķ WordPress er til umbreyta the vinna viš ręstingar eša gagnasafn og nįkvęmur samanburšur til UTF-8 eša Einhyrningur. Hvernig sem, žś GETA EKKI einfaldlega tengja til MySQL um skel eša phpMyAdmin og hoping allur žinn skrifletur vilja umbreyta fallega. Eins og śtskżra višWordPress gagnasafn ummyndun fylgja, umbreyta ešli stilliskrśfa žurfa using the the MySQL BREYTA BORŠ stjórn. Hvenęr umbreyta the ešli stilliskrśfa, allur TEXTI ( og lķkur) vallarmašur ert breytir til UTF-8, en žessi ummyndun vilja BROT žaš sem til er TEXTI žvķ the ummyndun bśast viš the gögn til vera ķ latķna, en WordPress mega hafa birgšir einhyrningur ešli ķ a latķna gagnasafn, og eins og a afleišing, gögn ) endir upp eins og sorp eftir į a ummyndun!

The fylgja afla a mjög hrjśfur og óljós fylgja eins og a lausn į hvernig til raunverulega umbreyta WordPress MySQL gagnasafn matskeiš frį einn stafasett til annar, venjulega UTF-8. Hvernig sem, the fylgja raunverulega verksmišja, enda žótt the ašferš geta vera langur. Til umbreyta, the stķga flókinn almennt ert til breyta hvor og sérhver TEXTI og skyldur vallarmašur inni sérhver WP matskeiš til Dropi, žį breyta the stafasett af gagnasafn og aš lokum breyting the DROPI vallarmašur bak til Texti. Śtlit žęgilegur, en hvernig langur žaš vildi taka til umbreyta svo margir vallarmašur į svo margir matskeiš? Enn fremur, žś vilja einnig žörf til muna the frumeintak tegund og lengd eša gildi af allur vallarmašur.

andersapt hefur staša a ummyndun skrifletur nafndagurconvert_to_utf8_sql_generator.txt hver į sjįlfvirkan hįtt mynda a listi af SQL stašhęfing og stjórn žörf til fullkomlega umbreyta žinn WordPress gagnasafn til UTF8 undirstaša į the fylgja. Hvernig sem, there viršast til vera a ólögrįša mašur padda meš the skrifletur, enda žótt the rithöfundur krafa žaš ķ uppnįmi, hvar ķ minn tilfelli, žaš einfaldlega vani’ mynda the listi af SQL stjórn til hlaupa sökum the villa “PHP Banvęnn villa: Kalla til a félagi virka get_results() į a non- mótmęla ķ convert.php į lķna 37″. Einu sinni fastur, meš this skrifletur ķ hönd viš geta aušveldlega og fljótt umbreyta the gagnasafn, matskeiš og vallarmašur til nota utf8_general_ci nįkvęmur samanburšur.

minnispunktur ÉG hafa reyndur śtUTF-8 Gagnasafn Breytir tappi, en žess’ a bilun. Žaš viršast eins og the rithöfundur breyting til stafasett beint.

Fylgja til Umbreyta WordPress Gagnasafn Stafasett til UTF8 ( einhyrningur)

  1. Taka the WordPress blog offline viš frišsęll a śt- af- žjónusta eša višhald taka eftir.
  2. Varabśnašur gagnasafn this er mjög mikilvęgur, ómerkingur er įbyrgš til vinna. Ef žinn’ using cPanel eša annar stjórna pallborš, žess’ bestur til framkvęma a gagnasafn varabśnašur frį the stjórna pallborš sig, hvar žś geta skila aftur the gagnasafn ķ einn stykki ķ stašinn af viš SQL stašhęfing, ķ the tilfelli af ešlilegur sorphaugur.
  3. Sękja skrį af fjarlęgri tölvu the fasturconvert_to_utf8_sql_generator.txt skrifletur og spara žaš meš a PHP eftirnafn.
  4. Breyta the skrifletur til inntak the gagnasafn nafn žinn WordPress blog er using. Stašgreina the hópur stušningsmanna texti:

    Tables_in_DATABASENAME

    The DATABASENAME ķ raušur er the eini hlutur žessi žś žörf til breyting til jafningi žinn WordPress gagnasafn nafn. Žaš öxl śtlit eins og this eftir į breyting, fyrir dęmi,

    Tables_in_wp_mydigitallife

  5. Senda skrį frį sinni tölvu til annarrar the convert_to_utf8_sql_generator.php ( eša žś geta gefa nżtt nafn til a stytta nafn svo sem eins og convert.php) til the undirstaša rót WordPress embęttisvķgsla skrį, hvar wp-config.php er einnig stašgreina.
  6. Nś, kalla og beit the skrifletur frį allir vefur flettitęki. Til gera this, einfaldlega bęta viš convert_to_utf8_sql_generator.php ( eša allir nafn žś gefa til the skrifletur) til the endir af žinn blog URL (i.e http:/www.mywebsite.com/convert_to_utf8_sql_generator.php) og žrżsta Koma inn ķ. A langur listi af SQL stašhęfing vilja vera mynda į the vefur blašsķša.
  7. Tryggja žessi žinn post_content og staša titill vallarmašur į wp_posts borš HJARTARSKINN EKKI eiga aš vera til allir eša FULLTEXT . Annars the tegund af the vallarmašur mega ekki vera breytir til DROPI meš einn af the villa listi nišri. Sumir tappi, svo sem eins og skyldur staša hafa tilhneigingu til bęta viš til žessir vallarmašur. Ķ this tilfelli, um stundarsakir falla the .

    VILLA 1170 (42000): DROPI/ TEXTI sśla ‘post_content’ notašur ķ lykill tilgreining įn a lykill lengd

    VILLA 1283 (HY000): Sśla ‘post_content’ geta ekki vera hluti af FULLTEXT

  8. Tenging til žinn framreišslumašur skel viš Telnet eša SSH. Žś geta sleppa this hluti af using Unix skel ef žś ętla til nota phpMyAdmin til gera the óhreinn vinna, en ÉG hafa ekki reyndur žaš. Svo ef žś gera, gera afturverkun į hvort žaš geta vera .
  9. Tengja til MySQL framreišslumašur frį the skel.
  10. Tölublaš the hópur stušningsmanna stjórn fyrstur ķ MySQL hvetja:

    nota DATABASENAME;

    Aftur, skipta um DATABASENAME ķ raušur til the raunverulegur WordPress gagnasafn nafn.

  11. Žį eftirlķking og klķstur the heild listi af SQL stašhęfing sjįlfvirkt farartęki mynda viš the ummyndun skrifletur, og klķstur žį inn ķ the MySQL hvetja. Hvor og sérhver SQL stjórn öxl nś vera ašferš og framkvęma viš MySQL einn viš einn. Žś mega žörf til žrżsta til gera śt af viš the sķšastur einn.
  12. Į mešan the vinnsla, the lķkur villa skilaboš skyldur til lykill lengd eins og umtal mega birtast. Ķ minn tilfelli, the ummyndun til DROPI mislukkašur meš svo sem skilaboš ķ the hópur stušningsmanna vallarmašur:

    wp_categories.category_nicename
    wp_comments.comment_approved
    wp_links.link_visible
    wp_options.option_name
    wp_postmeta.meta_key
    wp_posts.post_status
    wp_posts.post_name
    wp_posts.post_type
    wp_usermeta.meta_key
    wp_users.user_login

    Allur žessir vallarmašur ert ólķklegur til innihalda non-ASCII ešli. Og vallarmašur svo sem eins og category_nicename ( flokkur brekkusnigill) og post_name ( staša brekkusnigill) hafa been URL umrita ķ dulmįl ( hvar žinn URL meš ótraustur non- staftöluorš ešli vilja vera skipta um meš a prósent (%) skilti fylgismašur viš tveir įlög tölustafur og geimskip umrita ķ dulmįl eins og auk (+) skilti). Byrjunar- umrita ķ dulmįl af bęti merkjamįl og ešli framsal fyrir UTF-8 er samkvęmur ) meš ASCII, svo stjórna ummyndun af žessir vallarmašur til UTF8 öxl ekki koma meš of mikill vandamįl.

  13. Ritstżra the wp-config.php skrį til bęta viš ķ DB_CHARSET og DB_COLLATE skżring. Bęta viš the hópur stušningsmanna tveir lķnumašur, helst undir the hluti af MySQL Stilling:

    defineDB_CHARSET(’’, ‘utf8′);
    defineDB_COLLATE(’’, ”);

    Eins og śtskżra ķWordPress Gamalt handrit, DB_COLLATE er vinstri eyša ( nśll) svo žessi the gagnasafn nįkvęmur samanburšur vilja vera į sjįlfvirkan hįtt framsalshafi viš MySQL undirstaša į the gagnasafn stafasett.

  14. Endurskapa the og/ eša FULLTEXT been dropateljari, ef allir.
  15. Virkja the blog bak inn ķ framleišsla hįttur.
  16. Stöšva žinn blog til sjį ef allt og sérhver ešli er okay.
  17. Fella brott the PHP skrifletur.

mikilvęgur: This er a vél žżša blašsķša hver er meš žvķ skilyrši " eins og er" įn įbyrgš. Tölvužżšing mega vera erfišur til skilja. Žóknast vķsa til tilfrumeintak Englendingar hlutur alltaf žegar mögulegur.

Hluti og gefa eša fį tęknilegur support and help at My Digital Life Forums.



17 Responses to “How to Convert Character Set and Collation of WordPress Database”

  1. g30rg3_x
    June 23rd, 2007 04:27
    1

    Hi…
    I have to say (in my favor) that m not changing directly the database character set, please review my plugin and you will see that first it will convert your database binary and them to utf8 and finally it will put everything like before encoding but obviously with the UTF-8 character set…

    I prefer to do and a..
    ALTER TABLE table_name CONVERT TO CHARACTER SET binary
    Than just make a mysql sentence for every text/string field, because as you can see the problems comes with key and some index value and the BLOB field type change.
    Converting truth the sentence that my plugin use will transform all char to binary, all varchar to varbinary, all text (tynitext, text, mediumtext, longtext) to his binary representations (tinyblob, blob, mediumblob, longblob) and finally just set enum and set types with the collation binary.

    I just came here to say this in favor and by the way the majority of the problems of my plugins are related to host configurations and other things that obviously i can control.

    BTW its a better to solution to avoid problems of key and index by just setting the correct binary representation rather than using blob in all the way.

    Greetings from mexico and sorry for all mistyping problems.

  2. fotizo φωτίζω » Blog Archive » Wordpress 2.1 > 2.2.1
    July 11th, 2007 16:00
    2

    [...] MySQL ęœ¬čŗ«ēš„å•é”Œļ¼Œä¾æäø€ēŸ„åŠč§£åœ°åŽ»äŗ‚ setļ¼Œēµęžœäø€ęØ£ć€‚ć€‚ć€‚ (5:00) ē›“č‡³ęˆ‘č®€å®Œé€™ēÆ‡ę–‡ē« ļ¼Œē™¼ē¾ę˜Æ WP ē”± 2.1 å‡č‡³ 2.2.1 ä¹‹å¾Œļ¼Œé–±č®€ db ēš„ script ēœŸēš„č®Šäŗ†ļ¼Œč®€äøäŗ† SQL db [...]

  3. How to Backup and Restore (Export and Import) MySQL Databases Tutorial » My Digital Life
    July 21st, 2007 15:33
    3

    [...] If this case, use –default-character-set=charset_name option to specify the character set or convert the database to UTF8. Get help or contribute tips or tricks at My Digital Life [...]

  4. Wordpress 2.2 UTF Konvertierung | Blog[CHA] v2
    September 4th, 2007 18:57
    4

    [...] die Schnauze. Mit etwas mehr HartnƤckigkeit bei der Suche konnte ich am Ende dann doch noch eine passende Konvertierungsanleitung finden, die auf mystische Art und Weise sowohl auf das fehlerhafte Plugin hinweist, als auch die [...]

  5. Chris
    September 16th, 2007 02:04
    5

    Why don’t you just link the file directly here?

    It is pain to register just to download the file.

  6. curo.dk » Blog Archive » Wordpress charset problem and solution
    September 16th, 2007 03:15
    6

    [...] to convert my database to UTF8 so my blog doesn’t look funny. The plugin didn’t work, another site requires registration (how lame), so I came up with my own solution which is KISS all the [...]

  7. admin
    September 16th, 2007 03:59
    7

    Hi Chris, sorry for inconveniences, it’s so that users can discuss any bugs on the script on the forum when needed.

  8. Isotipo
    September 29th, 2007 03:23
    8

    [...] la codificación de acentos, ñ y símbolos para que funcionara bien. Para problemas recomiendo este artículo que indica los pasos para convertir tu bbdd a codificación [...]

  9. Octaedro » Una soluci
    November 17th, 2007 07:55
    9

    [...] ponga, siempre hay algo que me va a salir desconfigurado: los posts o los comentarios. He probado

  10. Back on track! | isa costa * the geek side
    November 19th, 2007 03:35
    10

    [...] ficheiro wp-config.php e deixar os valores das constantes DB_CHARSET e DB_COLLATE em branco. Outra solução é converter a base de dados toda para UTF-8, o que para mim jÔ soa a [...]

  11. Sergio Nascimento
    December 14th, 2007 03:05
    11

    Hi, it worked fine for me using MyPHPAdmin.

    Thanks for the article.

  12. Media Addicted
    February 27th, 2008 01:20
    12

    I’m using PHPmyAdmin and try to convert my database to utf-8, but…PHPmA interrupts the process with the first error message (concering key length as mentioned in ur guide).

    Is there a way to make PHPmA ignore errors to proceed the other tables?

    Thx in advance!

  13. If I have absolutely nothing to say : 2008030101
    March 2nd, 2008 01:52
    13

    [...] How to convert character set and collation of wordpress database?  [...]

  14. Larry Hirscg
    March 19th, 2008 03:32
    14

    I must applaud you for publishing this. After hours of searching for an easy solution, when my provider moved my database to an ā€œupgradedā€ platform, I was able to follow your instructions and and get the character set changed. I used the phpmyadmin to execute the code and deleted the lines that had errors. It ran perfectly and I only needed to edit a few slugs that had odd character in them. Fabulous!

  15. Links for 2008-03-30 [del.icio.us] » Festival BD-Comminges
    March 31st, 2008 13:09
    15

    [...] How to Convert Character Set and Collation of WordPress Database Guide to Convert WordPress Database Character Set to UTF8 (Unicode) — Ā» My Digital Life [...]

  16. … @ a distance … » UTF-8
    June 19th, 2008 12:19
    16

    [...] with troubleshooting the issue of not able to use the 2 lines in the wp-config.php file. Tried this method, but it didn’t work. Then I read up the idea of converting the SQL in a text editor. [...]

  17. something2
    July 24th, 2008 18:53
    17

    I’ve uploaded an extended script to the thread. It handles cases where the tables and columns are utf8 but the strings inside are latin1. This happens when the tables are created as utf8 but the wp-config.php is missing DB_CHARSET and DB_COLLATE variables.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

phpmyadmin change Collation - MySQL convert collation - mysql convert character set - convert collation - mysql convert encoding - mysql convert charset - oracle COLLATE - convert charset - php convert characters - mysql convert - change collation phpmyadmin - phpmyadmin character set - wordpress collation - phpmyadmin change table collation - wordpress charset - wordpress latin1_swedish_ci - mysql convert utf8 - oracle convert character set - phpmyadmin change encoding - oracle convert - mysql convert database encoding - collation convert - mysql convert table encoding - convert collation mysql - php convert character set - mysql convert character encoding - oracle character set - phpmyadmin collation - phpmyadmin change database collation - convert latin1_swedish_ci to utf8 - convert mysql collation - mysql convert character - convert collate - mysql convert database charset - php convert charset - latin1_swedish_ci wordpress - php convert character encoding - characterset - sql convert charset - mysql convert char - wordpress database encoding - sql php convert chinese - mysql charset converter - how to convert Object of class wpdb to string in php - funny characters phpmyadmin - latin1_swedish_ci wordpress database - mysql convert database character set - mysql collation conversion - mysql convert characters - change collation mysql - mysql CONVERT TO CHARACTER SET - convert character set - mysql change collation for all tables - php convert text encoding - php convert latin1 to utf8 - convert table collation mysql - convert_to_utf8_sql_generator.txt - collation change - wordpress charset problem with bulgarian - wordpress database convert - wordpress database collation - convert character encoding - php convert latin1 - wordpress change collation - CONVERT DATABASE TO UTF8 - MySQL convert to unicode - auto convert latin1 to utf-8 mysql php function - wordpress database name - convert mysql charset - mysql change collation - mysql "cannot be part of FULLTEXT index" - wordpress character sets - mysql change database encoding - oracle collation - latin1_swedish_ci to utf8 -