Hot Mic

Sponsors

MySQL Tech Bleg

So, I was searching through the archives for another post when I ran across this behavior:

One of the thorns in the side of any stateside carrier��operating close to home��is the “distinguished visitor” program. “DV’s” can be just about anybody with an interest in visiting an aircraft carrier at sea and who might plausibly be relied upon to share their – undoubtedly favorable – experiences back home. We get movie stars and professional athletes, captains of industry and Rotarians.

I have a vague notion that these strange characters might have something to do with shifting databases from one web host to another in the not-so-distant past, but it might also have to do with text encoding changes from latin to UTF-8 after version WordPress 2.2. This occurred in May 0f 2007, but the potential solution is dauntingly complex for a mere enthusiast.

Anybody have any better ideas?

  • Share/Bookmark

16 comments to MySQL Tech Bleg

  • Sim

    PS: It’s not just you, I noticed it trawling the archives the other day, I had assumed it was a Firefox thing from whatever dastardly mac thing you’re using.

  • I just lived through upgrading to WP 2.8 (from 2.3)and in all my old posts there is now an “A” with an “^” above it everywhere that used to be populated by a double space. My code angel told me it was also a UTF-8 code bug. The “A$$ hat”, my affectionate term for the bug, doesn’t show up in new posts. I’m afraid I can’t offer any tips to correct your problem since I’m just smart enough to be dangerous but I can confirm you’re on the right track, FWTW.

  • dm

    I don’t have any direct experience with mysql, nor wordpress, so I am making some guesses…

    What is the codepage of the database? In Oracle, you can find this by running ‘select * from v$nls_parameters’

    Once you have the codepage, does that match the env variables for the user on the server? For Oracle on Unix, you would run env | grep NLS* to get the NLS settings for that particular user. There is a syntax for that value for the NLS variables that I don’t quite recall.

    What has Mr. Google said about this? I have a feeling that other wordpress-ers might see something similar.

    What happened when you reverted to ISO8859-1, or Win1252, or whatever was the old codepage?

    Hope this helps, or at the very least, provides food for thought.

    Be cool,

    -DM

    PS: Congratulations on middle-sprog’s graduation!

  • Byron

    My only advice would be to get a bigger hammer ;)

  • virgil xenophon

    Comment removed by author due to immense stupidity.

  • G-man

    well for what an opinion is worth I like the new look. Altho yer getting dangerously artsy-fartsy for a fighter attack guy.

    Per Steve, 2.8 does have its bugs. wait for next ver.

    p.s. book status?

  • Ron Snyder

    I like the bigger hammer idea. :)

    Can’t say I like the new look though. Just IMO, and surely it could not be related to any end-user idosyncrancies.

  • Well…2.8 has it’s moments…but then it’s .8 on the 2 line.

    Trudged thru the 4 blog setups I have going. Two went like they were made to be, one I had to use FTP to pull about every plugin out, to get it to work, and it still has an issue on the Dashboard (in those new feed areas, so no big deal for now). $th one acted like it wasn’t going to auto install, but then it did…about 4th try, when i just his the “skip it” buttons (since I had backed it up) then I was back in battery on the main blog.

    Programmers: Can’t live with them, can’t shoot them. Just bribe them to put your bugs at the top of the “undocumented features” list for getting worked on.

  • JR

    I ran into this with my wife’s blog. I dumped it to a text file, used search and replace to clean up, dropped and reimported the table. The downtime was relatively small – though it did take a bit of work to clean up the file.

    Sorry – not too elegant and may not be doable for your situation.

  • Read this and send it to your favorite geek/slave.

    Failing that I bid $120.00 to do the conversion.

  • rs

    This is pretty simple if you know what you’re doing.

    Connect to your webhost via shell or CPanel/PhpMyAdmin. Example below is for shell access.

    ssh -l yourusnername http://www.neptunuslex.com
    enter password

    mysqldump -u yourmysqlusername -p yourmysqlpassword yourdatabasename > backup.20090614.sql

    copy the php file referenced at “http://www.mydigitallife.info/2007/06/23/how-to-convert-character-set-and-collation-of-wordpress-database/” to your wordpress install directory, and run it:

    wget http://forums.mydigitallife.info/attachment.php?attachmentid=34&d=1182541079 > wordpressinstalldirectory/fileijustsavedTowordpressinstalldirectory.php

    (the wget command actually will probably not work since that site wants you to be acually logged in; you’ll have to save the file locally and copy it to your wordpress install directory on your webhost).

    cd wordpressinstalldirectory
    php fileIjustsavedTowordpressinstalldirectory.php

    And maybe it works.

    If it doesn’t work:

    mysql -u yourmysqlusername -p yourmysqlpassword yourdatabasename < ~/backup.20090614.sql

    will restore your previous database.

    Good luck!

  • rs

    Oh yeah.

    If you don’t know your mysql login creds, they will be in your wordpressinstalldirectory/wp-config.php.

    Look for values db_name db_user db_password. db_host might be relevant as well. my previous example assumed that the database was running on the same host as the webserver. If the mysqldump command fails, add ” -h valueofdb_host” and you should be good.

    One final thing – omit the “http://” when you ssh to yourusername@www.neptunuslex.com

    • Mongo

      Task list:
      1. Copy/Paste all above from RS to text file for future use Done…
      2. 6 pack Beer chit to RS for above.
      3. Practice/make use of above from RS…

      v/r

    • rs

      I just wanted to add to this since I’m less sleepy now.

      In case you don’t have or don’t want to use shell access, the process is just to:

      - Backup your database. Make sure your backup is in “sql” format, NOT xml! An “export” from WordPress’s dashboard won’t help you.
      - Optional: Take your site down while you run the conversion. If you don’t, your site will mostly just appear slow, timeout, or possibly return an error page (depending on how WordPress handles database contention).
      - Copy that php file from above to your wordpress install directory.
      - You can run it in a browser if you don’t have shell access.
      - If successful, remove that php file from above.
      - If not successful, remove the php file from above and restore the database from your backup.

  • Snake Eater

    Sorry Lex…no help here. I’m still trying to figure out how a telepone works. Best

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

eXTReMe Tracker

View My Stats