view release on metacpan or search on metacpan
lib/ACME/QuoteDB/DB/DBI.pm view on Meta::CPAN
ACME::QuoteDB::DB::DBI->connection(
"DBI:mysql:database=$database;host=$host",$user,$pass,
{
RaiseError => 1,
mysql_enable_utf8 => 1,
}
)
|| croak "can not connect to: $database $!";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acrux/DBI.pm view on Meta::CPAN
my $url = $dbi->url;
$dbi = $dbi->url('sqlite:///tmp/test.db?sqlite_unicode=1');
$dbi = $dbi->url('sqlite:///./test.db?sqlite_unicode=1'); # '/./' will be removed
$dbi = $dbi->url('postgres://foo:pass@localhost/mydb?PrintError=1');
$dbi = $dbi->url('mysql://foo:pass@localhost/test?mysql_enable_utf8=1');
Database connect url
The database connection URL from which all other attributes can be derived.
C<"url"> must be specified before the first call to C<"connect"> is made,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Aion/Query.pm view on Meta::CPAN
sub base_connect {
my ($dsn, $user, $password, $conn) = @_;
my $base = DBI->connect($dsn, $user, $password, {
RaiseError => 1,
PrintError => 0,
$dsn =~ /^DBI:mysql/i ? (mysql_enable_utf8 => 1): (),
}) or die "Connect to db failed";
$base->do($_) for @$conn;
return $base unless wantarray;
my ($base_connection_id) = $dsn =~ /^DBI:(mysql|mariadb)/i
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/MWS/Uploader.pm view on Meta::CPAN
=item db_options
E.g.
{
mysql_enable_utf8 => 1,
}
AutoCommit and RaiseError are set by us.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amon2/DBI.pm view on Meta::CPAN
}
if ($dsn =~ /^dbi:SQLite:/i) {
$attr->{sqlite_unicode} = 1 unless exists $attr->{sqlite_unicode};
}
elsif ($dsn =~ /^dbi:mysql:/i) {
$attr->{mysql_enable_utf8} = 1 unless exists $attr->{mysql_enable_utf8};
}
elsif ($dsn =~ /^dbi:Pg:/i) {
my $dbd_pg_version = eval { require DBD::Pg; (DBD::Pg->VERSION =~ /^([.0-9]+)\./)[0] };
if ( !$@ and $dbd_pg_version < 2.99 ) { # less than DBD::Pg 2.99, pg_enable_utf8 must be set for utf8.
$attr->{pg_enable_utf8} = 1 unless exists $attr->{pg_enable_utf8};
lib/Amon2/DBI.pm view on Meta::CPAN
=item Set AutoInactiveDestroy to true.
If your DBI version is higher than 1.614, Amon2::DBI set AutoInactiveDestroy as true.
=item Set sqlite_unicode and mysql_enable_utf8 and pg_enable_utf8 automatically
Amon2::DBI set sqlite_unicode and mysql_enable_utf8 automatically.
If using DBD::Pg version less than 2.99, pg_enable_utf8 too.
=item Nested transaction management.
Amon2::DBI supports nested transaction management based on RAII like DBIx::Class or DBIx::Skinny. It uses L<DBIx::TransactionManager> internally.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Session/Browseable/DBI.pm view on Meta::CPAN
|| die $DBI::errstr;
if ( $datasource =~ /^dbi:sqlite/i ) {
$dbh->{sqlite_unicode} = 1;
}
elsif ( $datasource =~ /^dbi:mysql/i ) {
$dbh->{mysql_enable_utf8} = 1;
}
elsif ( $datasource =~ /^dbi:pg/i ) {
$dbh->{pg_enable_utf8} = 1;
}
return $dbh;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/AltSQL/Model/MySQL.pm view on Meta::CPAN
qw(database host port)
);
my $dbh = DBI->connect($dsn, $self->user, $self->password, {
PrintError => 0,
mysql_auto_reconnect => 1,
mysql_enable_utf8 => 1,
}) or die $DBI::errstr . "\nDSN used: '$dsn'\n";
$self->dbh($dbh);
## Update autocomplete entries
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DBBrowser/DB.pm view on Meta::CPAN
The result of the I<Attributes>* settings:
$attributes:
{
mysql_enable_utf8 => 0,
mysql_enable_utf8mb4 => 1,
mysql_bind_type_guessing => 1,
}
* OPTIONS/DB Options/DB Settings/$plugin
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MBUtiny/Collector/DBI.pm view on Meta::CPAN
user => "username",
password => "password",
set => [
"RaiseError 0",
"PrintError 0",
"mysql_enable_utf8 1",
],
);
print STDERR $dbi->error if $dbi->error;
=head1 DESCRIPTION
lib/App/MBUtiny/Collector/DBI.pm view on Meta::CPAN
user => "username",
password => "password",
set => [
"RaiseError 0",
"PrintError 0",
"mysql_enable_utf8 1",
],
);
Creates DBI object
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MonM/Notifier/Monotifier.pm view on Meta::CPAN
DSN "DBI:mysql:database=monotifier;host=mysql.example.com"
User username
Password password
Set RaiseError 0
Set PrintError 0
Set mysql_enable_utf8 1
# Expires and timeout values
Timeout 60
MaxTime 300
Expires 1M
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/MonM/Checkit/DBI.pm view on Meta::CPAN
User USER
Password PASSWORD
Timeout 15s
Set RaiseError 0
Set PrintError 0
Set mysql_enable_utf8 0
# . . .
</Checkit>
lib/App/MonM/Checkit/DBI.pm view on Meta::CPAN
There can be several such directives.
Examples:
Set sqlite_unicode 1
Set mysql_enable_utf8 0
Default: no specified
=item B<Timeout>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Office/Contacts.pm view on Meta::CPAN
Do a search for Brocard, the author of the original L<GraphViz>, and you will find LE<233>on Brocard.
Also, see lines 48 .. 52 in the config file for options to control the utf8 setting in the connect() attributes
as used by L<DBI>. These are the defaults:
mysql_enable_utf8 = 1
# pg_enable_utf8 == 0 for DBD::Pg V 3.0.0 in my code.
pg_enable_utf8 = 0
sqlite_unicode = 1
These values are used in App::Office::Contacts::Util::Logger lines 44 .. 57.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/OverWatch/DB/mysql.pm view on Meta::CPAN
my $conn = DBIx::Connector->new($dsn, $user, $password, {
RaiseError => 1,
PrintError => 0,
AutoCommit => 1,
mysql_enable_utf8 => 1,
});
return $conn;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/PhotoDB/funcs.pm view on Meta::CPAN
$$connect{'database'}{'pass'},
{
# Required for updates to work properly
mysql_client_found_rows => 0,
# Required to print symbols
mysql_enable_utf8mb4 => 1,
}
) or die "Couldn't connect to database: " . DBI->errstr;
&runmigrations($dbh) unless $skipmigrations;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ZofCMS/Plugin/CRUD.pm view on Meta::CPAN
can => 'CRUDL',
no_time_sort => 0,
opt => {
RaiseError => 1,
AutoCommit => 1,
mysql_enable_utf8 => 1,
},
# These are plug's parameters, but with no defaults
# dsn => 'DBI:mysql:database=zofdb;host=localhost',
# user => db_login
lib/App/ZofCMS/Plugin/CRUD.pm view on Meta::CPAN
user => 'db_login',
pass => 'db_pass',
opt => {
RaiseError => 1,
AutoCommit => 1,
mysql_enable_utf8 => 1,
},
items => [
'Item',
{ Description => [ 'textarea', optional => 1 ] },
{ File => 'file' },
lib/App/ZofCMS/Plugin/CRUD.pm view on Meta::CPAN
=head3 C<opt>
opt => {
RaiseError => 1,
AutoCommit => 1,
mysql_enable_utf8 => 1,
}
B<Optional>. Takes a hashref as a value. Specifies the
additional options for L<DBI>'s C<connect_cached()> method.
See L<DBI>'s docs for C<connect_cached()> method for more info on this
one. B<Defaults to:>
C<< { RaiseError => 1, AutoCommit => 1, mysql_enable_utf8 => 1, } >>
=head3 C<table>
table => 'products',
view all matches for this distribution
view release on metacpan or search on metacpan
aprojo.conf.mysql.example view on Meta::CPAN
'db_connect' => [
'DBI:mysql:database=aprojo;host=127.0.0.1;port=3306',
'aprojo',
'db_user_secret',
{
PrintError => 1, AutoCommit => 1, RaiseError => 1, mysql_enable_utf8 => 1,
}
],
'db_schema' => 'AproJo::DB::Schema',
'secret' => 'app_secret'
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AtteanX/Store/DBI.pm view on Meta::CPAN
$dsn .= ";host=$host";
}
if (defined($port)) {
$dsn .= ";port=$port";
}
$connect_args{mysql_enable_utf8} = 1;
} elsif ($type eq 'postgresql') {
$dsn = "DBI:Pg:dbname=${database}";
if (defined($host)) {
$dsn .= ";host=$host";
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/etc/engine.yaml view on Meta::CPAN
dsn: dbi:SQLite:dbname=t/var/bpmengine.db
user: testuser
password: TestPass
AutoCommit: 1
sqlite_unicode: 1
#mysql_enable_utf8: 1
#pg_enable_utf8: 1
#on_connect_call: use_foreign_keys
#on_connect_do:
# - PRAGMA synchronous = OFF
view all matches for this distribution
view release on metacpan or search on metacpan
etc/runit/legacy-metabase/etc/metabase.conf view on Meta::CPAN
{
broker => 'ws://127.0.0.1:9000',
db => {
dsn => 'dbi:mysql:mysql_read_default_file=~/.cpanstats.cnf;mysql_read_default_group=application;mysql_enable_utf8=1',
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
examples/build-pass-reports.pl view on Meta::CPAN
die "No configuration for $db database\n" unless($cfg->SectionExists($db));
my %opts = map {$_ => ($cfg->val($db,$_)||undef);} qw(driver database dbfile dbhost dbport dbuser dbpass);
$opts{AutoCommit} = 0;
$dbx = CPAN::Testers::Common::DBUtils->new(%opts);
die "Cannot configure $db database\n" unless($dbx);
$dbx->{'mysql_enable_utf8'} = 1 if($opts{driver} =~ /mysql/i);
$dbx->{'mysql_auto_reconnect'} = 1 if($opts{driver} =~ /mysql/i);
my @max = $dbx->get_query('hash','SELECT max(id) as max, count(*) as total FROM cpanstats');
my $max = $max[0]->{max};
my $total = $max[0]->{total};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Testers/Schema.pm view on Meta::CPAN
# Convenience connect method
sub connect_from_config ( $class, %config ) {
my $schema = $class->connect(
"DBI:mysql:mysql_read_default_file=$ENV{HOME}/.cpanstats.cnf;".
"mysql_read_default_group=application;mysql_enable_utf8=1",
undef, # user
undef, # pass
{
AutoCommit => 1,
RaiseError => 1,
mysql_enable_utf8 => 1,
quote_char => '`',
name_sep => '.',
%config,
},
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Labyrinth/Plugin/CPAN/Report.pm view on Meta::CPAN
}
sub _get_tester {
my $creator = shift;
#$dbi->{'mysql_enable_utf8'} = 1;
my @rows = $dbi->GetQuery('hash','GetTesterFact',$creator);
return ($creator,$creator) unless(@rows);
#$rows[0]->{fullname} = encode_entities($rows[0]->{fullname});
$rows[0]->{email} ||= $creator;
view all matches for this distribution
view release on metacpan or search on metacpan
etc/mycontainer.pl view on Meta::CPAN
# {
# RaiseError => 1,
# PrintError => 0,
# AutoCommit => 1,
# pg_enable_utf8 => 1, # for pg
# mysql_enable_utf8 => 1, # for mysql
# }
# ],
# },
},
};
view all matches for this distribution
view release on metacpan or search on metacpan
etc/mycontainer.pl view on Meta::CPAN
# {
# RaiseError => 1,
# PrintError => 0,
# AutoCommit => 1,
# pg_enable_utf8 => 1, # for pg
# mysql_enable_utf8 => 1, # for mysql
# quote_names => 1,
# }
# ],
# },
},
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/Schema/Utils.pm view on Meta::CPAN
$dsn =~ m/^dbi:(\w+)/;
$db_type = lc($1);
my %unicode_connection_for_db = (
'sqlite' => { sqlite_unicode => 1 },
'pg' => { pg_enable_utf8 => 1 },
'mysql' => { mysql_enable_utf8 => 1 },
);
$unicode_option = $unicode_connection_for_db{$db_type};
}
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Catmandu/Store/DBI.pm view on Meta::CPAN
my ($self) = @_;
my $opts = {
AutoCommit => 1,
RaiseError => 1,
mysql_auto_reconnect => 1,
mysql_enable_utf8 => 1,
pg_utf8_strings => 1,
sqlite_use_immediate_transaction => 1,
sqlite_unicode => 1,
};
my $dbh
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Class/Usul/TraitFor/ConnectInfo.pm view on Meta::CPAN
my $_get_dataclass_schema = sub {
return Class::Usul::File->dataclass_schema( @_ );
};
my $_unicode_options = sub {
return { mysql => { mysql_enable_utf8 => TRUE },
pg => { pg_enable_utf8 => TRUE },
sqlite => { sqlite_unicode => TRUE }, };
};
my $_dump_config_data = sub {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ClearPress/driver/mysql.pm view on Meta::CPAN
$self->{dbuser} || q[],
$self->{dbpass},
{
RaiseError => 1,
AutoCommit => 0,
mysql_enable_utf8 => 1,
});
# 2010-05-12 post-connect SET NAMES utf8 demonstrated to work a lot better than connect with mysql_enable_utf8 => 1
#
# Using test data: update run set payload='{"comment":"abc øéü"}' where id_run=2;
#
# this works on OSX MacPorts MySQL 5.1 but not on CentOS 5.4 MySQL 5.0
# perl -MDBI -e 'my $dbh = DBI->connect("DBI:mysql:host=localhost;dbname=ontrackt", "root", "", {RaiseError=>1});$dbh->do(q[update run set payload=? where id_run=2],{},q[abc øéµ]);print $dbh->selectall_arrayref(q[SELECT payload FROM run WHE...
#
# this works on OSX and CentOS:
# perl -MDBI -e 'my $dbh = DBI->connect("DBI:mysql:host=localhost;dbname=ontrackt", "root", "", {RaiseError=>1});$dbh->do(q[SET NAMES utf8]);$dbh->do(q[update run set payload=? where id_run=2],{},q[abc øéµ]);print $dbh->selectall_arrayref(q...
#
# this works on neither OSX nor CentOS
# perl -MDBI -e 'my $dbh = DBI->connect("DBI:mysql:host=localhost;dbname=ontrackt", "root", "", {RaiseError=>1,mysql_enable_utf8 =>1});$dbh->do(q[update run set payload=? where id_run=2],{},q[abc øéµ]);print $dbh->selectall_arrayref(q[SELEC...
$self->{dbh}->do(q[SET NAMES utf8]);
} or do {
croak qq[Failed to connect to $dsn using @{[$self->{dbuser}||q['']]}\n$EVAL_ERROR];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DB/Object/Mysql.pm view on Meta::CPAN
sub _connection_options
{
my $self = shift( @_ );
my $param = shift( @_ );
# This should really not be an option. This decode utf8 in database
$param->{mysql_enable_utf8} = 1 if( !CORE::exists( $param->{mysql_enable_utf8} ) );
my @mysql_params = grep( /^mysql_/, keys( %$param ) );
my $opt = $self->SUPER::_connection_options( $param );
@$opt{ @mysql_params } = @$param{ @mysql_params };
return( $opt );
}
view all matches for this distribution
view release on metacpan or search on metacpan
Changes.historic view on Meta::CPAN
Fix by Pali Rohár.
* Fix support for magic scalars (pali)
(https://github.com/perl5-dbi/DBD-mysql/pull/76)
2016-12-12 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.041_1)
* Unicode fixes: when using mysql_enable_utf8 or mysql_enable_utf8mb4,
previous versions of DBD::mysql did not properly encode input statements
to UTF-8 and retrieved columns were always UTF-8 decoded regardless of the
column charset.
Fix by Pali Rohár.
Reported and feedback on fix by Marc Lehmann
Changes.historic view on Meta::CPAN
* Add support for mysql_multi_statements connection option. (RT #12322, based
on patch from Doug Morris)
* Had to bump to 4.003 do to print statement in mysql.pm that made it
into the dist. Even though you can delete a file on CPAN, you cannot
re-upload it if it's the same name. Mea Culpa.
* UTF8-Flag not set with flag mysql_enable_utf8 and column collation utf8_bin patch,
Joost Diepenmaat, (RT #24738)
* Fixed do_error definition (Scott Hildreth, Tim Bunce)
* Conversion of test suite to Test::More
2007-3-5 Patrick Galbraith <patg at patg dot net> Jim Winstead <jimw@mysql.com> (4.003)
view all matches for this distribution