Skip to content
Snippets Groups Projects
Commit cfb40b5c authored by Graham McVicker's avatar Graham McVicker
Browse files

added option for database port

parent 4e556996
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ sub new {
$self->host( $host );
$self->password( $pass);
$self->user($user);
$self->port($port);
$self->limit($limit);
......@@ -49,12 +50,12 @@ sub new {
die("Target db $target already exists. Use -force option to overwrite.");
}
}
$dbh->do( "create database ".$self->target() );
$self->debug("Building schema for $target from $schema");
die "Cannot open $schema" if (! -e $schema);
my $cmd = "mysql -u $user -p$pass -h $host $target < $schema";
my $cmd = "mysql -u $user -p$pass -P $port -h $host $target < $schema";
system ($cmd);
......@@ -108,6 +109,12 @@ sub host {
return $self->{'host'};
}
sub port {
my $self = shift;
$self->{'port'} = shift if(@_);
return $self->{'port'};
}
sub password {
my $self = shift;
$self->{'password'} = shift if(@_);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment