Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encoding problem w/ DB migration 1

Status
Not open for further replies.

Crundy

Programmer
Jul 20, 2001
305
0
0
GB
Hello,
I'm trying to move a database from one server to another, but I'm getting characters such as unlauts turned into question marks on the target database. Running status on both databases shows the encoding to be different:

Source:
Server characterset: latin1
Db characterset: latin1
Client characterset: binary
Conn. characterset: binary

Destination:
Server characterset: latin1
Db characterset: utf8
Client characterset: latin1
Conn. characterset: latin1

When I perform a mysqldump, the non-standard characters get converted funny:

Source DB entry:
Weg des Glücks

Dump file entry:
Weg des Glücks

Destination DB entry:
Weg des Gl?cks

So it looks like the mysqldump is going wrong?

Does anyone know how to fix this? I admit to not knowing anything about character encoding!

C:\DOS:>
C:\DOS:>RUN
RUN DOS RUN!!
 
Use --default-character-set=latin1 with mysqldump i mysql:

mysqldump -h host -u user -p --default-character-set=latin1 databasename > plik.sql

mysql -h host -u -p --default-character-set=latin1 -D datbasename < plik.sql
 
That worked great. Thanks!
Have a star!

C:\DOS:>
C:\DOS:>RUN
RUN DOS RUN!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top