Use my.cnf to set charset when using DBI
authorJamie Cameron <jcameron@webmin.com>
Mon, 5 Jan 2009 17:35:02 +0000 (17:35 +0000)
committerJamie Cameron <jcameron@webmin.com>
Mon, 5 Jan 2009 17:35:02 +0000 (17:35 +0000)
mysql/mysql-lib.pl

index fd44f83..00ac533 100644 (file)
@@ -249,6 +249,8 @@ if ($driver_handle) {
        $cstr .= ";host=$config{'host'}" if ($config{'host'});
        $cstr .= ";port=$config{'port'}" if ($config{'port'});
        $cstr .= ";mysql_socket=$config{'sock'}" if ($config{'sock'});
+       $cstr .= ";mysql_read_default_file=$config{'my_cnf'}"
+               if (-r $config{'my_cnf'});
        local $dbh = $driver_handle->connect($cstr, $mysql_login, $mysql_pass,
                                             { });
        $dbh || &error("DBI connect failed : ",$driver_handle->errstr);