Help - MySQL Inconsistency

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


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-19-2007
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?


Reply With Quote
  #2 (permalink)  
Old 12-19-2007
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
Reply With Quote
  #3 (permalink)  
Old 12-19-2007
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/
Reply With Quote
  #4 (permalink)  
Old 12-19-2007
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/



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:19 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0