Help for this page

Select Code to Download


  1. or download this
    #!/bin/env perl
    
    ...
    $dsn = "dbi:mysql:mysql_ssl=1;database=$db;mysql_read_default_file=$cf
    +g_file;mysql_read_default_group=test_group;host=$host";
    $dbh = DBI->connect($dsn);
    print "\$dbh = $dbh\n";
    
  2. or download this
    Without host=$host
    DBI connect('mysql_ssl=1;database=****;mysql_read_default_file=/tmp/my
    +.cnf;mysql_read_default_group=test_group','',...) failed: Can't conne
    +ct to local MySQL server through socket '/var/run/mysql.sock' (2) at 
    +/tmp/test_db.pl line 12.
    
    With host=$host
    $dbh = DBI::db=HASH(0xa00318a18)
    
  3. or download this
    [test_group]
    host=****
    ...
    password=****
    no-auto-rehash
    ssl=1