Unix Technical Forum

Help - MySQL Inconsistency

This is a discussion on Help - MySQL Inconsistency within the MySQL forums, part of the Database Server Software category; --> I'm running a web app with MySQL 5.041-community-nt on my web server and on my development machine. Both environments ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:30 AM
weheh
 
Posts: n/a
Default Help - MySQL Inconsistency

I'm running a web app with MySQL 5.041-community-nt on my web server and on
my development machine. Both environments run Apache 2.2., Windows XP, OS:
Windows XP, Python 2.3. There might be a configuration difference between
systems, but I've been fairly consciencious about keep them in synch.

I'm going for an end-to-end UTF8 web implementation. On my server, when I
put strings into my MySQL database I have to encode them UTF8. On my
development machine, I don't. I prefer the development environment 'cause it
makes for smaller, simpler code ... which then doesn't work on my server.
It's making life murder for debugging before releasing.

Does anybody have an idea what might be causing this?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:30 AM
Good Man
 
Posts: n/a
Default Re: Help - MySQL Inconsistency

"weheh" <weheh@verizon.net> wrote in news:Jf%9j.3651$Uq4.1118@trnddc06:

> I'm running a web app with MySQL 5.041-community-nt on my web server
> and on my development machine. Both environments run Apache 2.2.,
> Windows XP, OS: Windows XP, Python 2.3. There might be a configuration
> difference between systems, but I've been fairly consciencious about
> keep them in synch.
>
> I'm going for an end-to-end UTF8 web implementation. On my server,
> when I put strings into my MySQL database I have to encode them UTF8.
> On my development machine, I don't. I prefer the development
> environment 'cause it makes for smaller, simpler code ... which then
> doesn't work on my server. It's making life murder for debugging
> before releasing.
>
> Does anybody have an idea what might be causing this?


Take a look at my.cnf or similar and make sure the following lines are
there under [mysqld], well at least the first:

character-set-server=utf8
default-collation=utf8_unicode_ci
default-character-set=utf8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 11:30 AM
Willem Bogaerts
 
Posts: n/a
Default Re: Help - MySQL Inconsistency

> I'm going for an end-to-end UTF8 web implementation. On my server, when I
> put strings into my MySQL database I have to encode them UTF8. On my
> development machine, I don't.


You'll have to inform MySQL what encoding you use. If you have a buch of
strings in, say, latin-1, send a "SET NAMES latin1" command to the
server and do your INSERTs and UPDATEs. If you have a bunch of utf8
strings, use "SET NAMES utf8".

Good luck,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 11:30 AM
weheh
 
Posts: n/a
Default Re: Help - MySQL Inconsistency

I always do a SET NAMES utf8 before inserting or selecting anything from the
db.

"Willem Bogaerts" <w.bogaerts@kratz.maardanzonderditstuk.nl> wrote in
message news:4768db2c$0$85787$e4fe514c@news.xs4all.nl...
>> I'm going for an end-to-end UTF8 web implementation. On my server, when I
>> put strings into my MySQL database I have to encode them UTF8. On my
>> development machine, I don't.

>
> You'll have to inform MySQL what encoding you use. If you have a buch of
> strings in, say, latin-1, send a "SET NAMES latin1" command to the
> server and do your INSERTs and UPDATEs. If you have a bunch of utf8
> strings, use "SET NAMES utf8".
>
> Good luck,
> --
> Willem Bogaerts
>
> Application smith
> Kratz B.V.
> http://www.kratz.nl/



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:45 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com