# Issue with perl scripts after upgrading to mysql55-client-5.5.8



## mlager (Jan 8, 2011)

I used `portupgrade -r` to upgrade mysql55-client-5.5.7 to 5.5.8, which went fine. I can connect to the MySQL-5.5.8 server using the mysql CLI. When I execute some perl scripts that I have which utilize p5-DBD, I get the following message:


```
Character set 'latin1' is not a compiled character set and is not specified in the '/usr/local/share/mysql/charsets/Index.xml' file
DBI connect('fbsd_mgmt:172.16.2.1:3306','mlager',...) failed: Can't initialize character set latin1 (path: /usr/local/share/mysql/charsets/) at 
/root/bin/fbsd_mgmt/fbsd_mgmt.pl line 27
Can't call method "prepare" on an undefined value at /root/bin/fbsd_mgmt/fbsd_mgmt.pl line 43.
```

Here is where I'm at as far as DBI, DBD, and mysql-client versions:


```
mysql-client-5.5.8  Multithreaded SQL database (client)
p5-DBD-mysql55-4.017 MySQL 5.5 driver for the Perl5 Database Interface (DBI)
p5-DBI-1.615        The perl5 Database Interface.  Required for DBD::* modules
```

I've researched like crazy and can't find a resolution, except to downgrade using portupgrade, but portupgrade doesn't find mysql55-client, so I feel stuck.

Any advice would be appreciated.


----------



## vand777 (Jan 8, 2011)

Did you try to recompile all the ports which depend on mysql?


----------



## SPEEDIE (Jan 9, 2011)

Hi,

I first ran in to prob on the 26th of Dec '10 - when I upgraded via portupgrade  mysql5.5.8   I'm not 100% sure, but I believe I was running 5.5.7 to which ran fine, but 5.5.8 uses a different compiler..

My server is FreeBSD 8.1-RELEASE  I do not have any issues between PHP 5.3.4 and MySQL 5.5.8.

Only Perl, to which at the time I was running Perl 5.10.1  I upgraded a Jail to 5.12.0 - but it made no difference...  I'm enabled Tracing, so I'll dump the output of the Perl -> MySQL 5.5.8 issue:


```
$ DBI_TRACE=2 perl dee.WHO.server.pl
    DBI 1.615-nothread default trace level set to 0x0/2 (pid 31679 pi 0) at DBI.pm line 278 via dee.WHO.server.pl line 24
    -> DBI->connect(DBI:mysql:dbname=dee;host=localhost, dee, ****, HASH(0x8103bd8))
    -> DBI->install_driver(mysql) for freebsd perl=5.010001 pid=31679 ruid=0 euid=0
       install_driver: DBD::mysql version 4.017 loaded from /usr/local/lib/perl5/site_perl/5.10.1/mach/DBD/mysql.pm
    <- install_driver= DBI::dr=HASH(0x83a7b6c)
    !! warn: 0 CLEARED by call to connect method
    -> connect for DBD::mysql::dr (DBI::dr=HASH(0x83a7b6c)~0x8425c28 'dbname=dee;host=localhost' 'dee' **** HASH(0x830eed0))
imp_dbh->connect: dsn = dbname=dee;host=localhost, uid = dee, pwd = mysecurepass
imp_dbh->my_login : dbname = dee, uid = dee, pwd = mysecurepass,host = localhost, port = NULL
imp_dbh->mysql_dr_connect: host = |localhost|, port = 0, uid = dee, pwd = mysecurepass
imp_dbh->bind_type_guessing: 0
imp_dbh->use_server_side_prepare: 0
imp_dbh->mysql_dr_connect: client_flags = 2
Character set 'latin1' is not a compiled character set and is not specified in the '/usr/local/share/mysql/charsets/Index.xml' file
imp_dbh->mysql_dr_connect: <-           --> do_error
Can't initialize character set latin1 (path: /usr/local/share/mysql/charsets/) error 2019 recorded: Can't initialize character set latin1 
(path: /usr/local/share/mysql/charsets/)
                <-- do_error
         DESTROY for DBI::db=HASH(0x8424614) ignored - handle not initialised
    !! ERROR: 2019 'Can't initialize character set latin1 (path: /usr/local/share/mysql/charsets/)' (err#0)
    <- connect= undef at DBI.pm line 665
    -> $DBI::errstr (&) FETCH from lasth=HASH
    <- $DBI::errstr= 'Can't initialize character set latin1 (path: /usr/local/share/mysql/charsets/)'
       DBI connect('dbname=dee;host=localhost','dee',...) failed: Can't initialize character set latin1 (path: /usr/local/share/mysql/charsets/)
DBI connect('dbname=dee;host=localhost','dee',...) failed: Can't initialize character set latin1 (path: /usr/local/share/mysql/charsets/) at 
dee.WHO.server.pl line 51
    -- DBI::END ($@: , $!: )
    !! ERROR: 2019 CLEARED by call to disconnect_all method
    -> disconnect_all for DBD::mysql::dr (DBI::dr=HASH(0x83a7b6c)~0x8425c28)
    <- disconnect_all= (not implemented) at DBI.pm line 743
!   -> DESTROY in DBD::_::common for DBD::mysql::dr (DBI::dr=HASH(0x8425c28)~INNER)
!   <- DESTROY= undef during global destruction
$
```

I've tried many different things to this..  changing the charset, updating the files in the charsets/ dir.. etc.. and changing the DBI->connect string to force a different charset... but even if I do force a different charset, it complains about that one in the same way.   I've  Customised the MySQL Cmakefile to force in extra compiled charsets, but it makes no difference.

Really love to know of a solution to this,  I only affecting 1 service on my server to which does not harm anything if it's not running, what would really love to get Perl to talk to MySQL again.


Hope that Trace helps..  Please let me know if you want any other data.  I'm happen to supply anything to which may help debunk this issue.


Thanks


----------



## SPEEDIE (Jan 9, 2011)

*Perl -> MySQL 5.5.8 Problem has been fixed*

Hi, I did a portupgrade tonight.. and it's all fixed

Many thanks for the port master to get this fixed, had me puzzled for 2 weeks...

Upgrade from 'mysql-server-5.5.8' to 'mysql-server-5.5.8_1'

Fixed the latin1 charset not found problem



Thanks Again.


----------



## DutchDaemon (Jan 9, 2011)

mlager, can you confirm this?


----------



## distorto_666 (Jan 18, 2011)

Thanks all - this was driving me up the wall - updating to 5.5.8_2 successfully solved this issue for me as well


----------

