view release on metacpan or search on metacpan
lib/Koha/Contrib/Sudoc/Koha.pm view on Meta::CPAN
";port=" . $c->{port},
$c->{user}, $c->{pass} )
) or carp $DBI::errstr;
if ( $c->{db_scheme} eq 'mysql' ) {
# Force utf8 communication between MySQL and koha
$self->dbh->{ mysql_enable_utf8 } = 1;
$self->dbh->do( "set NAMES 'utf8'" );
my $tz = $ENV{TZ};
($tz) and $self->dbh->do( qq(SET time_zone = "$tz") );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Koha/Contrib/Tamil/Koha.pm view on Meta::CPAN
";port=" . $c->{port},
$c->{user}, $c->{pass} )
) or carp $DBI::errstr;
if ( $c->{db_scheme} eq 'mysql' ) {
# Force utf8 communication between MySQL and koha
$self->dbh->{ mysql_enable_utf8 } = 1;
$self->dbh->do( "set NAMES 'utf8'" );
$self->dbh->{ mysql_auto_reconnect } = 1;
my $tz = $ENV{TZ};
($tz) and $self->dbh->do( qq(SET time_zone = "$tz") );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lemonldap/NG/Common/Conf/Backends/_DBI.pm view on Meta::CPAN
if ( $self->{dbiChain} =~ /^dbi:sqlite/i ) {
$self->{_dbh}->{sqlite_unicode} = 1;
}
elsif ( $self->{dbiChain} =~ /^dbi:mysql/i ) {
eval {
$self->{_dbh}->{mysql_enable_utf8} = 1;
$self->{_dbh}->do("set names 'utf8'");
};
}
elsif ( $self->{dbiChain} =~ /^dbi:pg/i ) {
$self->{_dbh}->{pg_enable_utf8} = 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lemonldap/NG/Portal/Lib/DBI.pm view on Meta::CPAN
if ( $conf->{dbiAuthChain} =~ /^dbi:sqlite/i ) {
$self->{_dbh}->{sqlite_unicode} = 1;
}
elsif ( $conf->{dbiAuthChain} =~ /^dbi:mysql/i ) {
eval {
$self->{_dbh}->{mysql_enable_utf8} = 1;
$self->{_dbh}->do("set names 'utf8'");
};
}
elsif ( $conf->{dbiAuthChain} =~ /^dbi:pg/i ) {
$self->{_dbh}->{pg_enable_utf8} = 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MPMinus.pm view on Meta::CPAN
$m->set( r => $r );
# Set mysql as MPMinus::Store::MySQL object
$m->set( mysql => new MPMinus::Store::MySQL(
-m => $m,
-attributes => {mysql_enable_utf8 => 1
})
) unless $m->mysql;
# Set disp as MPMinus::Dispatcher object
$m->set(
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MToken/Store.pm view on Meta::CPAN
user => "username",
password => "password",
set => [
"RaiseError 0",
"PrintError 0",
"mysql_enable_utf8 1",
],
);
die($store->error) unless $store->status;
lib/MToken/Store.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/Mail/DMARC/Report/Store/SQL.pm view on Meta::CPAN
or croak
"can't locate DB $db AND can't find $schema! Create $db manually.\n";
}
$self->{grammar} = Mail::DMARC::Report::Store::SQL::Grammars::SQLite->new();
} elsif ($dsn =~ /mysql/i) {
$opts{'mysql_enable_utf8mb4'} = 1;
$self->{grammar} = Mail::DMARC::Report::Store::SQL::Grammars::MySQL->new();
} elsif ($dsn =~ /pg/i) {
$self->{grammar} = Mail::DMARC::Report::Store::SQL::Grammars::PostgreSQL->new();
} else {
croak "can't determine database type, so unable to load grammar.\n";
view all matches for this distribution
view release on metacpan or search on metacpan
NonBlocking.xs view on Meta::CPAN
maria->store_query_result = FETCH_FROM_HV("mysql_use_results")
? cBOOL(SvTRUE(*svp) ? FALSE : TRUE)
: TRUE;
/* TODO: DBD::mysql compat mysql_enable_utf8 / mysql_enable_utf8mb4 */
if ( config->charset_name && strlen(config->charset_name) )
mysql_options(
maria->mysql,
MYSQL_SET_CHARSET_NAME,
config->charset_name
view all matches for this distribution
view release on metacpan or search on metacpan
t/2011-12-17.mkd.t view on Meta::CPAN
schema_class => "MyApp::Schema",
connect_info => {
dsn => $ENV{DB_DSN} || "dbi:mysql:test_db:127.0.0.1",
user => $ENV{DB_USER} || "test_user",
pass => $ENV{DB_PASSWORD} || "test_password",
mysql_enable_utf8 => 1,
},
loader_options => {
dump_directory => 'lib',
naming => { ALL => 'v8' },
skip_load_external => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-basic.t view on Meta::CPAN
my $dbh_outside = DBI->connect($data_source, $user, $password, {
'AutoCommit' => 1,
'ChopBlanks' => 1,
'ShowErrorStatement' => 1,
'pg_enable_utf8' => 1,
'mysql_enable_utf8' => 1,
});
cmp_ok(ref $dbh_outside,'eq','DBI::db', 'DBH created successfully');
SKIP: {
t/00-basic.t view on Meta::CPAN
my $dbh = MemcacheDBI->connect($data_source, $user, $password, {
'AutoCommit' => $AutoCommit,
'ChopBlanks' => 1,
'ShowErrorStatement' => 1,
'pg_enable_utf8' => 1,
'mysql_enable_utf8' => 1,
});
ok(ref $dbh, 'MemcacheDBH created successfully AutoCommit='.$AutoCommit);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojar/Mysql/Connector.pm view on Meta::CPAN
# Attributes
has quiesce_timeout => 500;
my @DbdFields = qw(RaiseError PrintError PrintWarn AutoCommit TraceLevel
mysql_auto_reconnect mysql_enable_utf8);
has RaiseError => 1;
has PrintError => 0;
has PrintWarn => 0;
has AutoCommit => 1;
has TraceLevel => 0;
has mysql_auto_reconnect => 0;
has mysql_enable_utf8 => 1;
my @ConFields = qw(label cnfdir cnf cnfgroup);
has 'label';
has cnfdir => '.';
lib/Mojar/Mysql/Connector.pm view on Meta::CPAN
first constructed. (The DSN tuple does not persist and is constructed fresh on
each call to C<connect>.)
In the examples above, $dbh1 and $dbh2 are not equivalent because the second
connector would also incorporate module defaults and use-time parameters, in
addition to the passed parameters. So, for instance, mysql_enable_utf8 might be
included in the second connector.
=head2 C<dsn>
@dbi_args = Mojar::Mysql::Connector->dsn(
lib/Mojar/Mysql/Connector.pm view on Meta::CPAN
All connector parameters are implemented as attributes with exactly the same
spelling. So for example you can
$connector->RaiseError(undef); # disable RaiseError
$connector->mysql_enable_utf8(0); # disable mysql_enable_utf8
The attributes, with their coded defaults, are
RaiseError => 1
PrintError => 0
PrintWarn => 0
AutoCommit => 1
TraceLevel => 0
mysql_auto_reconnect => 0
mysql_enable_utf8 => 1
label
cnfdir => '.'
cnf
cnfgroup
lib/Mojar/Mysql/Connector.pm view on Meta::CPAN
=head1 CHARACTER ENCODINGS
To read/store characters encoded as non-ASCII, non-UTF8, you must disable
handling of UTF-8.
$connector = Mojar::Mysql::Connector->new(mysql_enable_utf8 => 0);
This is essential, for example, when fetching high-latin (eg non-ASCII 8859-1)
characters.
=head1 DEBUGGING
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojo/mysql.pm view on Meta::CPAN
};
has options => sub {
my $self = shift;
my $options = {AutoCommit => 1, AutoInactiveDestroy => 1, PrintError => 0, RaiseError => 1};
$options->{mysql_enable_utf8} = 1 if $self->dsn =~ m!^dbi:mysql:!;
return $options;
};
has [qw(password username)] => '';
has pubsub => sub {
lib/Mojo/mysql.pm view on Meta::CPAN
=head2 options
my $options = $mysql->options;
$mysql = $mysql->options({mysql_use_result => 1});
Options for database handles, defaults to activating C<mysql_enable_utf8> (only
for L<DBD::mysql>), C<AutoCommit>, C<AutoInactiveDestroy> as well as
C<RaiseError> and deactivating C<PrintError>. C<AutoCommit> and C<RaiseError>
are considered mandatory, so deactivating them would be very dangerous.
C<mysql_auto_reconnect> is never enabled, L<Mojo::mysql> takes care of dead connections.
C<AutoCommit> cannot not be disabled, use $db->L<begin|Mojo::mysql::Database/"begin"> to manage transactions.
C<RaiseError> is enabled for blocking and disabled in event loop for non-blocking queries.
About C<mysql_enable_utf8>:
The mysql_enable_utf8 sets the utf8 charset which only supports up to 3-byte
UTF-8 encodings. mysql_enable_utf8mb4 (as of DBD::mysql 4.032) properly
supports encoding unicode characters to up to 4 bytes, such as ð . It means the
connection charset will be utf8mb4 (supported back to at least mysql 5.5) and
these unicode characters will be supported, but no other changes.
See also L<https://github.com/jhthorsen/mojo-mysql/pull/32>
view all matches for this distribution
view release on metacpan or search on metacpan
script/mojomojo_spawn_db.pl view on Meta::CPAN
# Determine database type amongst: SQLite, Pg or MySQL
my $db_type = lc($dsn =~ m/^dbi:(\w+)/);
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};
}
else {
$dsn = $config->{'Model::DBIC'}->{'connect_info'};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MojoX/Mysql/DB.pm view on Meta::CPAN
my $dbh = DBI->connect("DBI:mysql:".$config->{'dsn'}, $config->{'user'}, $config->{'password'}, {
AutoCommit=>0,
RaiseError=>0,
PrintError=>0,
mysql_enable_utf8=>1,
mysql_auto_reconnect=>1,
mysql_write_timeout=>$config->{'write_timeout'},
mysql_read_timeout=>$config->{'read_timeout'},
});
lib/MojoX/Mysql/DB.pm view on Meta::CPAN
my $dbh = DBI->connect("DBI:mysql:".$conf->{'dsn'}, $conf->{'user'}, $conf->{'password'}, {
AutoCommit=>0,
RaiseError=>0,
PrintError=>0,
mysql_enable_utf8=>1,
mysql_auto_reconnect=>1,
mysql_write_timeout=>$conf->{'write_timeout'},
mysql_read_timeout=>$conf->{'read_timeout'},
mysql_connect_timeout=>$conf->{'connect_timeout'},
});
view all matches for this distribution
view release on metacpan or search on metacpan
ShowErrorStatement => 1,
AutoCommit => 1,
RaiseError => 1,
PrintError => 1,
pg_enable_utf8 => 1,
#mysql_enable_utf8 => 1,
#mysql_auto_reconnect=>1,
}],
# will do on connect
do => ['set datestyle to "ISO, DMY";',],
# prepared sth will get $app->sth->{<dbh name>}{<sth name>}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Nour/Database.pm view on Meta::CPAN
password: dong
option:
AutoCommit: 1
RaiseError: 1
PrintError: 1
mysql_enable_utf8: 1
mysql_auto_reconnect: 1
=back
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MyConf.pm view on Meta::CPAN
$config->{'mysql'}->{'user'},
$config->{'mysql'}->{'pass'},
{
PrintError => 0,
RaiseError => 1,
mysql_enable_utf8mb4 => 1,
}
);
}
sub BUILD {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBI/Library.pm view on Meta::CPAN
$m_dsn, $m_sUser, $m_sPass,
{
RaiseError => 1,
PrintError => 0,
AutoCommit => 1,
#mysql_enable_utf8 => 1
}
)
or warn "$DBI::Library::errs";
$self->void("SET NAMES 'utf8_general_ci'");
if (!$install && $m_sDatabase eq '%DATABASE%') {
view all matches for this distribution
view release on metacpan or search on metacpan
RaiseError => ($this->{raise} ? 1:0),
PrintError => ($this->{raise} ? 0:1),
AutoCommit => 0,
mysql_enable_utf8 => 1,
mysql_compression => 1,
mysql_ssl => 1,
mysql_auto_reconnect => 1,
});
view all matches for this distribution
view release on metacpan or search on metacpan
t/02_mysqld.t view on Meta::CPAN
$connect_info[3] = {
RaiseError => 1,
PrintError => 0,
ShowErrorStatement => 1,
AutoInactiveDestroy => 1,
mysql_enable_utf8 => 1,
};
my $dbh = DBI->connect(@connect_info);
use MySQL::Partition;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MySQL/Warmer/CLI.pm view on Meta::CPAN
my @dsn = ($dsn, $user, $password, {
RaiseError => 1,
PrintError => 0,
ShowErrorStatement => 1,
AutoInactiveDestroy => 1,
mysql_enable_utf8 => 1,
});
(+{
dsn => \@dsn,
$dry_run ? (dry_run => 1) : (),
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/DirectConnect/pslib/pssql.pm view on Meta::CPAN
},
'mysql5' => {
'dbi' => 'mysql',
'user' => 'root',
'use_drh' => 1,
'mysql_enable_utf8' => 1,
'varchar_max' => 65530,
'unique_max' => 1000,
'primary_max' => 999,
'fulltext_max' => 1000,
'key_length' => 1000, # maybe 3072 for mariadb
lib/Net/DirectConnect/pslib/pssql.pm view on Meta::CPAN
$self->set_names() if $ENV{'MOD_PERL'} || $ENV{'FCGI_ROLE'};
},
'params' => [
qw(host port database mysql_client_found_rows mysql_compression mysql_connect_timeout mysql_read_default_file mysql_read_default_group mysql_socket
mysql_ssl mysql_ssl_client_key mysql_ssl_client_cert mysql_ssl_ca_file mysql_ssl_ca_path mysql_ssl_cipher
mysql_local_infile mysql_embedded_options mysql_embedded_groups mysql_enable_utf8)
], # perldoc DBD::mysql
'insert_by' => 1000, ( !$ENV{'SERVER_PORT'} ? ( 'auto_check' => 1 ) : () ), 'unique name' => 1, # test it
'match' => sub {
my $self = shift;
my ( $param, $param_num, $table, $search_str, $search_str_stem ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/OAuth2/AccessToken.pod view on Meta::CPAN
can be passed to L<session_thaw()|Net::OAuth2::AccessToken/"Constructors"> to get revived.
The C<changed> flag will be cleared by this method.
Be sure that your storage is character-set aware. For instance, you
probably want to set 'mysql_enable_utf8' when you store this in a
MySQL database. Perl's JSON module will output utf8 by default.
=item $obj-E<gt>B<to_json>()
Freeze this object into JSON. The JSON syntax is also used by the OAuth2
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Z3950/DBIServer.pm view on Meta::CPAN
# client, but SimpleServer doesn't seem to have a way to do this
# yet. You can pass an error code but no addInfo.
# I can't imagine why this isn't the default
#$this->{dbh}->{'mysql_enable_utf8'} = 1;
warn "UTF8='" . $this->{dbh}->{'mysql_enable_utf8'} . "'";
}
sub search_handler {
my $args = shift();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Nile/DBI.pm view on Meta::CPAN
$arg{driver} ||= "mysql";
$arg{dsn} ||= "";
$arg{host} ||= "localhost";
$arg{port} ||= 3306;
$arg{attr} ||= +{};
#$arg{attr} = {RaiseError => 0, PrintError => 0, mysql_enable_utf8 => 1}
if (!$arg{name}) {
$app->abort("Database error: Empty database name.");
}
lib/Nile/DBI.pm view on Meta::CPAN
}
$self->dbh($dbh);
return $dbh;
#$dbh->{'mysql_enable_utf8'} = 1;
#$dbh->do('SET NAMES utf8');
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=head2 disconnect()
view all matches for this distribution
view release on metacpan or search on metacpan
config/database/config.yml view on Meta::CPAN
username: this_is_not_hidden
option:
AutoCommit: 1
RaiseError: 1
PrintError: 1
mysql_enable_utf8: 1
mysql_auto_reconnect: 1
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Object/Container/Exporter.pm view on Meta::CPAN
#register($register_name, $initializer_code);
register db => sub {
my $self = shift;
$self->load_class('DBI');
DBI->connect('dbi:mysql:sandbox', 'root', 'pass', +{
mysql_enable_utf8 => 1,
PrintError => 0,
RaiseError => 1,
},);
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PEF/Front/Connector.pm view on Meta::CPAN
my ($driver) = $dbname =~ /^dbi:(\w*?)(?:\((.*?)\))?:/i;
if ($driver) {
if ($driver eq 'Pg') {
%extra_flag = (pg_enable_utf8 => 1);
} elsif ($driver eq 'mysql') {
%extra_flag = (mysql_enable_utf8 => 1);
}
}
$conn = PEF::Front::_connector->new(
$dbname, $dbuser, $dbpass,
{ AutoCommit => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pask/Config.pm view on Meta::CPAN
foreach (keys %{$config->{"schema"}}) {
Pask::Container::set_database_config "$prefix$_", {
"dsn" => "DBI:mysql:" . $config->{"schema"}{$_} . ";host=" . $config->{"ip"},
"username" => $config->{"username"},
"password" => $config->{"password"},
"options" => { mysql_enable_utf8 => 1 }
};
}
}
sub parse_database_config {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Pepper/DB.pm view on Meta::CPAN
PrintError => 0,
RaiseError => 0,
AutoCommit => 0,
ShowErrorStatement => 1,
HandleError => \&dbi_error_handler,
mysql_enable_utf8 => 8
});
# let's automatically reconnect if the connection is timed out
$self->{dbh}->{mysql_auto_reconnect} = 1;
# note that this doesn't seem to work too well
view all matches for this distribution