view release on metacpan or search on metacpan
preserved.
Example:
$dbh = new AnyEvent::DBI
"DBI:mysql:test;mysql_read_default_file=/root/.my.cnf", "", "";
Additional key-value pairs can be used to adjust behaviour:
=over 4
and passed as the final argument to the C<< DBI->connect (...) >>
call. For example, to suppress errors on STDERR and send them instead to an
AnyEvent::Handle you could do:
$dbh = new AnyEvent::DBI
"DBI:mysql:test;mysql_read_default_file=/root/.my.cnf", "", "",
PrintError => 0,
on_error => sub {
$log_handle->push_write ("DBI Error: $@ at $_[1]:$_[2]\n");
};
view all matches for this distribution
view release on metacpan or search on metacpan
my %backend = (
mysql => {
'mysql://user@127.0.0.1/minion'
=> [qw( mysql mysql://user@127.0.0.1/minion )],
'mysql+dsn+dbi:mysql:mysql_read_default_file=~/.my.cnf'
=> [qw( mysql dsn dbi:mysql:mysql_read_default_file=~/.my.cnf )],
},
Pg => {
'postgres://user@127.0.0.1/minion' => [qw( Pg postgres://user@127.0.0.1/minion )],
},
MongoDB => {
view all matches for this distribution
view release on metacpan or search on metacpan
bin/bp_seqfeature_gff3 view on Meta::CPAN
accepted by Bio::DB::SeqFeature::Store->features().
END
$ADAPTOR ||= 'DBI::mysql';
$DSN ||= $ADAPTOR eq 'DBI::mysql' ? "mysql_read_default_file=$ENV{HOME}/.my.cnf" : '';
my $store = Bio::DB::SeqFeature::Store->new(
-dsn => $DSN,
-adaptor => $ADAPTOR,
-user => $USER,
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/Bio-DB-SeqFeature-Store/bp_seqfeature_gff3.pl view on Meta::CPAN
accepted by Bio::DB::SeqFeature::Store->features().
END
$ADAPTOR ||= 'DBI::mysql';
$DSN ||= $ADAPTOR eq 'DBI::mysql' ? "mysql_read_default_file=$ENV{HOME}/.my.cnf" : '';
my $store = Bio::DB::SeqFeature::Store->new(
-dsn => $DSN,
-adaptor => $ADAPTOR,
-user => $USER,
view all matches for this distribution
view release on metacpan or search on metacpan
COPY ./etc/docker/api/my.cnf /root/.cpanstats.cnf
COPY ./etc/docker/api/api.development.conf /app
COPY ./etc/docker/legacy-metabase/metabase.conf /app
ENV MOJO_HOME=/app \
BEAM_MINION='mysql+dsn+dbi:mysql:mysql_read_default_file=~/.cpanstats.cnf;mysql_read_default_group=application' \
MOJO_PUBSUB_EXPERIMENTAL=1 \
MOJO_MAX_MESSAGE_SIZE=33554432
CMD [ "cpantesters-api", "daemon", "-l", "http://*:4000" ]
EXPOSE 4000
view all matches for this distribution
view release on metacpan or search on metacpan
Rex::Logger::info( 'Ensuring user profile is correct' );
for my $file ( qw( .profile .bash_profile ) ) {
append_if_no_such_line '/home/cpantesters/' . $file,
'export BEAM_PATH=$HOME/etc/container';
append_if_no_such_line '/home/cpantesters/' . $file,
'export BEAM_MINION="mysql+dsn+dbi:mysql:mysql_read_default_file=~/.cpanstats.cnf;mysql_read_default_group=application"';
}
Rex::Logger::info( 'Restarting services' );
run 'sv restart ~/service/minion';
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Testers/Schema.pm view on Meta::CPAN
#pod host = ""
#pod database = cpanstats
#pod user = my_usr
#pod password = my_pwd
#pod
#pod See L<DBD::mysql/mysql_read_default_file>.
#pod
#pod C<%extra_conf> will be added to the L<DBIx::Class::Schema/connect>
#pod method in the C<%dbi_attributes> hashref (see
#pod L<DBIx::Class::Storage::DBI/connect_info>).
#pod
#pod =cut
# 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,
lib/CPAN/Testers/Schema.pm view on Meta::CPAN
host = ""
database = cpanstats
user = my_usr
password = my_pwd
See L<DBD::mysql/mysql_read_default_file>.
C<%extra_conf> will be added to the L<DBIx::Class::Schema/connect>
method in the C<%dbi_attributes> hashref (see
L<DBIx::Class::Storage::DBI/connect_info>).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DB/Object/Mysql.pm view on Meta::CPAN
{
my $con =
{
'database' => 'mysql',
};
$con->{mysql_read_default_file} = '/etc/my.cnf' if( -f( '/etc/my.cnf' ) );
if( CORE::exists( $ENV{ 'DB_MYSQL_CON' } ) )
{
@$con{ qw( host login passwd ) } = split( /;/, $ENV{ 'DB_MYSQL_CON' } );
}
else
lib/DB/Object/Mysql.pm view on Meta::CPAN
my $self = shift( @_ );
my $param = shift( @_ );
my $core = [qw( db login passwd host port driver database server opt uri debug cache_connections cache_table unknown_field )];
my @mysql_params = grep( /^mysql_/, keys( %$param ) );
# See DBD::mysql for the list of valid parameters
# E.g.: mysql_client_found_rows, mysql_compression mysql_connect_timeout mysql_write_timeout mysql_read_timeout mysql_init_command mysql_skip_secure_auth mysql_read_default_file mysql_read_default_group mysql_socket mysql_ssl mysql_ssl_client_key...
push( @$core, @mysql_params );
return( $core );
}
sub _dsn
{
my $self = shift( @_ );
# "DBI:mysql:database=$sql_db;host=$sql_host;port=$sql_port;mysql_read_default_file=/etc/my.cnf"
my @params = ( sprintf( 'dbi:%s:database=%s', @$self{ qw( driver database ) } ) );
if( $self->{host} )
{
$self->_load_class( 'Net::IP' ) || return( $self->pass_error );
my $ip = Net::IP->new( $self->{host} );
lib/DB/Object/Mysql.pm view on Meta::CPAN
push( @params, sprintf( 'host=%s', $self->{host} ) );
}
}
# my @params = sprintf( "dbi:%s:database=%s;host=%s", @$self{ qw( driver database server ) } );
push( @params, sprintf( 'port=%d', $self->{port} ) ) if( $self->{port} );
push( @params, sprintf( 'mysql_read_default_file=%s', $self->{mysql_read_default_file} ) ) if( $self->{mysql_read_default_file} );
return( join( ';', @params ) );
}
sub _placeholder_regexp { return( $PLACEHOLDER_REGEXP ) }
view all matches for this distribution
view release on metacpan or search on metacpan
Changes.historic view on Meta::CPAN
1998-11-06 Jochen Wiedmann <joe@ispsoft.de> (1.21_06)
* dbd/dbdimp.c: Changed isspace(c) to c == ' ' in ChopBlanks
handling.
* dbd/dbdimp.c: Added $dbh->{'mysql_read_default_file'} and
$dbh->{'mysql_read_default_group'}.
* dbd/dbdimp.c: Added $dbh->{'mysql_insertid'}.
1998-10-23 Jochen Wiedmann <joe@ispsoft.de> (1.21_05)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/mysql.pm view on Meta::CPAN
=item mysql_skip_secure_auth
This option is for older mysql databases that don't have secure auth set.
=item mysql_read_default_file
=item mysql_read_default_group
These options can be used to read a config file like /etc/my.cnf or
~/.my.cnf. By default MySQL's C client library doesn't use any config
files unlike the client programs (mysql, mysqladmin, ...) that do, but
outside of the C client library. Thus you need to explicitly request
reading a config file, as in
$dsn = "DBI:mysql:test;mysql_read_default_file=/home/joe/my.cnf";
$dbh = DBI->connect($dsn, $user, $password)
The option mysql_read_default_group can be used to specify the default
group in the config file: Usually this is the I<client> group, but
see the following example:
lib/DBD/mysql.pm view on Meta::CPAN
If you read this config file, then you'll be typically connected to
I<localhost>. However, by using
$dsn = "DBI:mysql:test;mysql_read_default_group=perl;"
. "mysql_read_default_file=/home/joe/my.cnf";
$dbh = DBI->connect($dsn, $user, $password);
you'll be connected to I<perlhost>. Note that if you specify a
default group and do not specify a file, then the default config
files will all be read. See the documentation of
view all matches for this distribution
view release on metacpan or search on metacpan
=item * msql_configfile
=item * mysql_compression
=item * mysql_read_default_file/mysql_read_default_group
=item * mysql_socket
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/mysqlPPrawSjis.pm view on Meta::CPAN
=item * msql_configfile
=item * mysql_compression
=item * mysql_read_default_file/mysql_read_default_group
=item * mysql_socket
=back
view all matches for this distribution
view release on metacpan or search on metacpan
our $VERSION = 1;
sub admin_connection {
my $schema = __PACKAGE__->connect(
"DBI:mysql:mysql_read_default_file=pathtoadmincreds.cnf;mysql_read_default_group=schema_group",
undef,
undef,
{
AutoCommit => 1,
RaiseError => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/DBFlow.pm view on Meta::CPAN
our $VERSION = 1;
sub admin_connection {
my $schema = __PACKAGE__->connect(
"DBI:mysql:mysql_read_default_file=pathtoadmincreds.cnf;mysql_read_default_group=schema_group",
undef,
undef,
{
AutoCommit => 1,
RaiseError => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/DBH/mysql.pm view on Meta::CPAN
use Params::Validate qw( :all );
@optional_mysql_ = qw(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
lib/DBIx/DBH/mysql.pm view on Meta::CPAN
=over 4
=item * mysql_client_found_rows
=item * mysql_compression
=item * mysql_connect_timeout
=item * mysql_read_default_file
=item * mysql_read_default_group
=item * mysql_socket
=item * mysql_ssl
=item * mysql_ssl_client_key
=item * mysql_ssl_client_cert
view all matches for this distribution
view release on metacpan or search on metacpan
examples/sqlcrosstab_example.pl view on Meta::CPAN
"","",{RaiseError=>1, PrintError=> 0 });
}
elsif($driver eq 'mysql') {
# Adjust host, username, and password according to your needs
$dbh = DBI->connect("dbi:mysql:crosstab; host=localhost"
. ";mysql_read_default_file=$ENV{HOME}/.my.cnf" # only Unix. Remove this line for Windows
, undef, # username
undef, # password
{RaiseError=>1, PrintError=> 0 })
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
xt/connect.pm view on Meta::CPAN
use Exporter;
our @EXPORT = qw( dbi_connect );
sub dbi_connect {
return DBI->connect( "dbi:@{[eval{require DBD::mysql; 1}?'mysql:test;mysql_read_default_file':'MariaDB:test;mariadb_read_default_file']}=$ENV{HOME}/.my.cnf", undef, undef,
{
RaiseError => 1,
AutoCommit => 1,
PrintError => 0,
}
view all matches for this distribution
view release on metacpan or search on metacpan
Normalizer.pm view on Meta::CPAN
use DBSchema::Normalizer;
my $norm = DBSchema::Normalizer->new ({
DSN => "DBI:mysql:music;host=localhost;"
. "mysql_read_default_file=$ENV{HOME}/.my.cnf",
src_table => "MP3",
index_field => "album_id",
lookup_fields => "artist,album,genre",
lookup_table => "tmp_albums",
dest_table => "songs",
Normalizer.pm view on Meta::CPAN
no strict; # Yup. No strict either.
use DBSchema::Normalizer;
$norm = DBSchema::Normalizer->new (
{
DSN => "DBI:mysql:music;host=localhost;"
. "mysql_read_default_file=$ENV{HOME}/.my.cnf",
src_table => "MP3",
index_field => "album_id",
lookup_fields => "artist,album,genre",
lookup_table => "tmp_albums",
dest_table => "songs",
Normalizer.pm view on Meta::CPAN
sub snew { # shortcut new (parameters called by position)
my ($class, $host, $db, $src_table, $index_field,
$lookup_fields, $lookup_table, $dest_table,
$copy_indexes, $verbose, $simulate) = @_;
my $DSN= "DBI:mysql:$db;host=$host;"
. "mysql_read_default_file=$ENV{HOME}/.my.cnf";
return new ($class, {
DSN => $DSN,
src_table => $src_table,
index_field => $index_field,
lookup_fields => $lookup_fields,
view all matches for this distribution
view release on metacpan or search on metacpan
EasyDBAccess.pm view on Meta::CPAN
$_name_utf8='utf8';
#============================================
#============================================
$_dbh_attr_default = {PrintError=>0,RaiseError=>0,LongReadLen=>1048576,FetchHashKeyName=>'NAME_lc',AutoCommit=>1};
$_mysql_conn_attrib= ['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...
$_mysql_error_code_map={
ER_DUP_ENTRY=>1062, #Duplicate entry for key
ER_NO_SUCH_TABLE=>1146, #No such table
ER_PARSE_ERROR=>1064 #SQL string parse error
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojar/Mysql/Connector.pm view on Meta::CPAN
# MySQL .cnf file
$cnf .= '.cnf' unless $cnf =~ /\.cnf$/;
$cnf = catfile $param->cnfdir, $cnf if ! -r $cnf and defined $param->cnfdir;
croak "Failed to find/read .cnf file ($cnf)" unless -f $cnf and -r $cnf;
$cnf_txt = ';mysql_read_default_file='. $cnf;
$cnf_txt .= ';mysql_read_default_group='. $param->cnfgroup
if defined $param->cnfgroup;
}
# DBD params
view all matches for this distribution
view release on metacpan or search on metacpan
t/connection.t view on Meta::CPAN
note 'Quote fieldnames correctly';
like $mysql->abstract->select("foo", ['binary']), qr{`binary}, 'quoted correct binary';
like $mysql->abstract->select("foo", ['foo.binary']), qr{`foo`.`binary}, 'quoted correct foo.binary';
$mysql = Mojo::mysql->new(dsn => 'dbi:mysql:mysql_read_default_file=~/.cpanstats.cnf');
is $mysql->dsn, 'dbi:mysql:mysql_read_default_file=~/.cpanstats.cnf', 'correct dsn';
$mysql = Mojo::mysql->new({dsn => 'dbi:mysql:mysql_read_default_file=~/.cpanstats.cnf'});
is $mysql->dsn, 'dbi:mysql:mysql_read_default_file=~/.cpanstats.cnf', 'correct dsn';
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
mysql/lib/DBD/mysql.pm view on Meta::CPAN
If your DSN contains the option "mysql_connect_timeout=##", the connect
request to the server will timeout if it has not been successful after
the given number of seconds.
=item mysql_read_default_file
=item mysql_read_default_group
These options can be used to read a config file like /etc/my.cnf or
~/.my.cnf. By default MySQL's C client library doesn't use any config
files unlike the client programs (mysql, mysqladmin, ...) that do, but
outside of the C client library. Thus you need to explicitly request
reading a config file, as in
$dsn = "DBI:mysql:test;mysql_read_default_file=/home/joe/my.cnf";
$dbh = DBI->connect($dsn, $user, $password)
The option mysql_read_default_group can be used to specify the default
group in the config file: Usually this is the I<client> group, but
see the following example:
mysql/lib/DBD/mysql.pm view on Meta::CPAN
If you read this config file, then you'll be typically connected to
I<localhost>. However, by using
$dsn = "DBI:mysql:test;mysql_read_default_group=perl;"
. "mysql_read_default_file=/home/joe/my.cnf";
$dbh = DBI->connect($dsn, $user, $password);
you'll be connected to I<perlhost>. Note that if you specify a
default group and do not specify a file, then the default config
files will all be read. See the (missing :-) documentation of
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MySQL/RunSQL.pm view on Meta::CPAN
my %dbparams = ( RaiseError => 1, PrintError => 1 );
my $dsn = "DBI:mysql:database=$args{'database'};host=$args{'host'};"
. "port=$args{'port'};mysql_read_default_group=$args{'group_name'};"
. "mysql_read_default_file=$args{'my_cnf'};mysql_compression=1";
my $user;
my $password;
#Connect to the server and share the db handle with the rest of the package
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MySQL/Slurp.pm view on Meta::CPAN
default => sub {
my $dsn = join( ';',
"DBI:mysql:database=" . $_[0]->database ,
# "host=" . $_[0]->host ,
"mysql_read_default_file=~/.my.cnf" ,
"mysql_compression=1" ,
"mysql_use_result=1"
);
return DBI->connect( $dsn );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/DirectConnect/pslib/pssql.pm view on Meta::CPAN
'on_user' => sub {
my $self = shift;
$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 {
view all matches for this distribution
view release on metacpan or search on metacpan
t/scan/pod.t view on Meta::CPAN
'on_user' => sub {
my $self = shift;
$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 {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Project/Easy/Helper.pm view on Meta::CPAN
"database" : null,
"mysql_multi_statements": 0,
"mysql_enable_utf8": 1,
"mysql_auto_reconnect": 1,
"mysql_read_default_group": "perl",
"mysql_read_default_file": "{$root}/etc/my.cnf"
},
"options": {
"RaiseError": 1,
"AutoCommit": 1,
"ShowErrorStatement": 1
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rose/DB/MySQL.pm view on Meta::CPAN
sub mysql_connect_timeout { shift->dbh_attribute_boolean('mysql_connect_timeout', @_) }
sub mysql_embedded_groups { shift->dbh_attribute('mysql_embedded_groups', @_) }
sub mysql_embedded_options { shift->dbh_attribute('mysql_embedded_options', @_) }
sub mysql_local_infile { shift->dbh_attribute('mysql_local_infile', @_) }
sub mysql_multi_statements { shift->dbh_attribute_boolean('mysql_multi_statements', @_) }
sub mysql_read_default_file { shift->dbh_attribute('mysql_read_default_file', @_) }
sub mysql_read_default_group { shift->dbh_attribute('mysql_read_default_group', @_) }
sub mysql_socket { shift->dbh_attribute('mysql_socket', @_) }
sub mysql_ssl { shift->dbh_attribute_boolean('mysql_ssl', @_) }
sub mysql_ssl_ca_file { shift->dbh_attribute('mysql_ssl_ca_file', @_) }
sub mysql_ssl_ca_path { shift->dbh_attribute('mysql_ssl_ca_path', @_) }
lib/Rose/DB/MySQL.pm view on Meta::CPAN
Returns the value of this attribute in the L<dbh|Rose::DB/dbh>, if one exists, or the value that will be set when the L<dbh|Rose::DB/dbh> is next created.
See the L<DBD::mysql|DBD::mysql/mysql_multi_statements> documentation to learn more about this attribute.
=item B<mysql_read_default_file [STRING]>
Get or set the L<mysql_read_default_file|DBD::mysql/mysql_read_default_file> database handle attribute. This is set directly on the L<dbh|Rose::DB/dbh>, if one exists. Otherwise, it will be set when the L<dbh|Rose::DB/dbh> is created. If no value ...
Returns the value of this attribute in the L<dbh|Rose::DB/dbh>, if one exists, or the value that will be set when the L<dbh|Rose::DB/dbh> is next created.
See the L<DBD::mysql|DBD::mysql/mysql_read_default_file> documentation to learn more about this attribute.
=item B<mysql_read_default_group [STRING]>
Get or set the L<mysql_read_default_group|DBD::mysql/mysql_read_default_group> database handle attribute. This is set directly on the L<dbh|Rose::DB/dbh>, if one exists. Otherwise, it will be set when the L<dbh|Rose::DB/dbh> is created. If no valu...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Tripletail/DB.pm view on Meta::CPAN
password = PASS
DBã«æ¥ç¶ããéã®ãã¹ã¯ã¼ããè¨å®ããã
çç¥å¯è½ã
=item C<< mysql_read_default_file >>
mysql_read_default_file = .../tl_mysql.cnf
mysql ã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªã使ç¨ããè¨å®ãã¡ã¤ã« my.cnf ã®ãã¹ãæå®ããã
ãã¹ã®æå®ã .../ ã§å§ãããã¨ã§ã ini ãã¡ã¤ã«ããã®ç¸å¯¾ãã¹ã¨ãã¦æå®ããäºãå¯è½ã
è¨å®ãã¡ã¤ã«ã使ç¨ããäºã§ã default-character-set çã® Tripletail::DB ã DBD::mysql ããã¯è¨å®ã§ããªãé
ç®ãè¨å®ã§ããã
ã¾ããè¨å®ãã¡ã¤ã«ã§ user, password, host çã®å¤ãæå®ããå ´åã¯ã Ini ãã©ã¡ã¼ã¿ ã®DBã³ãã¯ã·ã§ã³ã®å¤ãçç¥ããäºãã§ããã(dbname ã ãã¯çç¥ã§ããªã)
=item C<< mysql_read_default_group >>
mysql_read_default_group = tripletail
mysql_read_default_file æå®æã«ãè¨å®ãã¡ã¤ã«ä¸ã®ã©ã®ã°ã«ã¼ãã使ç¨ããããæå®ããã
ã°ã«ã¼ããæå®ããå ´åã¯ã [client] ã°ã«ã¼ãã®è¨å®ã¨æå®ããã°ã«ã¼ãã®è¨å®ã®ä¸¡æ¹ãæå¹ã«ãªãã
ã°ã«ã¼ããæå®ããªãå ´åã [client] ã°ã«ã¼ãã®è¨å®ã®ã¿ãæå¹ã¨ãªãã
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/URI/Shortener.pm view on Meta::CPAN
my $port = $self->{dbport} // $ENV{MYSQL_TCP_PORT} || 3306;
my $user = $self->{dbuser} // $ENV{DBI_USER};
my $pass = $self->{dbpass} // $ENV{MYSQL_PWD};
# Handle the mysql defaults file
my $defaults_file = $self->{mysql_read_default_file} // "$ENV{HOME}/.my.cnf";
my $defaults_group = $self->{mysql_read_default_group} // 'client';
my $df = "";
$df .= "mysql_read_default_file=$defaults_file;" if -f $defaults_file;
$df .= "mysql_read_default_group=$defaults_group;" if $defaults_group;
my $dsn = "dbi:mysql:mysql_multi_statements=1;database=$dbname;".$df."host=$host;port=$port";
my $db = DBI->connect($dsn, $user, $pass);
lib/URI/Shortener.pm view on Meta::CPAN
dbhost defaults to localhost, and dbport defaults to the relevant default port.
Otherwise the relevant ENV vars are obeyed when no options are passed.
See _my_dbh() and _pg_dbh() for the particulars.
Also, mysql will obey the mysql_read_default_file/group parameters, and defaults to using ~/.my.cnf and the 'client' group.
=item C<prefix>
URI prefix of shortened output. Trailing slashes will be stripped. Example: https://big.hugs/go/
view all matches for this distribution