At 0:49 +0200 4/25/05, Fagyal Csongor wrote:
Harald,

Perhaps the following excerpt from "perldoc DBD::mysql" is relevant
for you:

 mysql_read_default_file
 mysql_read_default_group
    These options can be used to read a config file
    like /etc/my.cnf or ~/.my.cnf. By default MySQL's
    C client library doesn't use any config files
    unlike the client programs (mysql, mysqladmin,
    ...) that do, but outside of the C client library.
    Thus you need to explicitly request reading a con-
    fig file, as in

        $dsn = "DBI:mysql:test;mysql_read_default_file=/home/joe/my.cnf";
        $dbh = DBI->connect($dsn, $user, $password)

Put "character_set_client = latin2" into your my.cnf ant tell Perl to
read it.

Hmmm... thank you, I have missed that! I guess that would solve my problem... I mean, almost: by giving this option to DBI, I substitute my current SET... command with DBI reading and parsing the config file, which, as the matter of fact, might be even more expensive than a single SET. (That is, if I do not use persistent connections.)

DBI doesn't read the config file, DBD::mysql does.

It's not expensive at all.  Why do you think it's expensive?


It would be nicer if DBD could read the config file during the "use phase" (for example in BEGIN { ... } ). But I guess I am getting a little to perl-ish now :-)

DBD reads the config file (once) when it connects to the server. How would reading it in the "use phase" be any more efficient?

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to