PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > - MySQL Inconsistency
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
- MySQL Inconsistency

Réponse
 
LinkBack Outils de la discussion
Vieux 19/12/2007, 03h22   #1
weheh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut - 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?


  Réponse avec citation
Vieux 19/12/2007, 05h16   #2
Good Man
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: - 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
  Réponse avec citation
Vieux 19/12/2007, 09h49   #3
Willem Bogaerts
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: - 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/
  Réponse avec citation
Vieux 19/12/2007, 17h41   #4
weheh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: - 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/



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h01.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08853 seconds with 12 queries