Skip to content

Instantly share code, notes, and snippets.

@drKreso
Created March 2, 2013 08:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save drKreso/5070183 to your computer and use it in GitHub Desktop.
use DBIish;
# The file 'lib.pl' customizes the testing environment per DBD, but all
# this test script currently needs is the variables listed here.
my $mdriver = 'mysql';
my $host = 'localhost';
my $port = 3306;
my $database = 'zavolaj';
my $test_user = 'root';
my $test_password = '';
my $drh;
$drh = DBIish.install_driver($mdriver);
say $drh.Version;
my $dbh = DBIish.connect($mdriver, :user($test_user), :password($test_password),
:$host, :$port, :$database,
RaiseError => 1, PrintError => 1, AutoCommit => 0
);
# die "ERROR: {MiniDBI.errstr}. Can't continue test" if $!.defined;
if $dbh.defined {
say "Connected to database";
}
$dbh.disconnect();
-------------------
Cannot locate native library 'libmysqlclient.bundle'
in method postcircumfix:<( )> at lib/NativeCall.pm6:122
in at src/gen/BOOTSTRAP.pm:883
in any at src/gen/BOOTSTRAP.pm:867
in method connect at lib/DBDish/mysql.pm6:282
in method connect at lib/DBIish.pm6:9
in block at baza.pl:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment