Announcement

Announcement Module
Collapse
No announcement yet.

Using perl script to connect to xtradb

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using perl script to connect to xtradb

    Hi,

    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,$dbpass word)# 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
    Example:

    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.

  • #2
    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.

    Comment

    Working...
    X