接続/切断DSN# MySQL $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; # PostgreSQL $dsn = "dbi:Pg:dbname=$dbname;host=$host;port=$port"; # SQLite $dsn = "dbi:SQLite:dbfile.db"; 接続/切断$dbh = DBI->connect($dsn, $user, $pass, {RaiseError=>1, PrintError=>0, AutoCommit=>1}) or die $DBI::errstr; $dbh->disconnect; 結果セットの文字列をUTF8フラグ付きにするmy $dbh = DBI->connect( $DSN, 'user', 'pass', { pg_enable_utf8 => 1 } ) or die $DBI::errstr;
|
|