Using perl script to connect to xtradb


I am trying to write a perl script to connect to xtradb (and retrieve datas later on).

When using MYSQL, we can write Perl as the following.

#!/usr/local/bin/perluse DBI;# to connect$dbh = DBI -> connect (“DBI:mysql:$dbname:localhost”,$dbusername,$dbpassword)# to select$sql = “select * from testtable”;$sth = $dbh->prepare($sql);$sth -> execute()

In xtradb, we could use --default-files to specify where is our my.cnf

mysql --defaults-file=/mydir/my.cnf -uroot -ppassword

Anyone knows how to imply this to the Perl script?
Or any sample perl connection script?

Thank you.

You can include the mysql_read_defaults_file option in your connection string (the first option to DBI->connect() ). See the DBD::mysql perldoc for details on this and other options.