Re: Character set problem
Posted by: Alex NS
Date: November 25, 2009 04:34AM

Hi,

I've had a look to that but I haven't been able to solve the problem yet:

This is the status of my db by default:

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

If I do a SET NAMES utf8; I get this for the current session:

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

Is it a problem that the server characterset is still latin1?

I'm trying to migrate data form a MS SQL database in UTF8 to my MySql database with a Perl script, so following your information I've done this:

my $dbh1 = DBI->connect(
'dbi:Sybase:server=' .
$db{'live'}{'S_DBI_HOST'},
$db{'live'}{'S_DBI_USER'},
$db{'live'}{'S_DBI_PASSWD'},
{
Warn => 1,
PrintWarn => 1,
PrintError => 1,
AutoCommit => 1,
mysql_enable_utf8 => 1,
on_connect_do => [ "SET NAMES 'utf8'", "SET CHARACTER SET + 'utf8'" ]
}
) or die "Can't connect to dbh: $DBI::errstr";

my $db="DBI:mysql:".$VMSTK_DB;
my $dbh2 = DBI->connect($db,$VMSTK_DB_USER, $VMSTK_DB_PASSWD,
{ RaiseError => 1, AutoCommit => 0, mysql_enable_utf8 => 1 })
or die "Couldn't connect to database: " . DBI->errstr;

$dbh2->{'mysql_enable_utf8'} = 1;
my $sql = qq{SET NAMES 'utf8';};
$dbh2->do($sql);

I'm still getting the same error. Any suggestion, please?

Options: ReplyQuote


Subject
Views
Written By
Posted
6490
November 23, 2009 10:46AM
2601
November 24, 2009 10:49PM
Re: Character set problem
4948
November 25, 2009 04:34AM
3378
November 26, 2009 12:52PM
2628
November 25, 2009 12:44PM
2443
November 26, 2009 04:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.