diff --git a/scripts/homer_mysql_remove_partitions.pl b/scripts/homer_mysql_remove_partitions.pl index d2da42f..5163537 100755 --- a/scripts/homer_mysql_remove_partitions.pl +++ b/scripts/homer_mysql_remove_partitions.pl @@ -162,9 +162,9 @@ sub db_connect { my $db_name = shift; my $dbistring = ""; if($CONFIG->{"MYSQL"}{"usesocket"}) { - $dbi = "DBI:mysql:database=".$CONFIG->{"MYSQL"}{$db_name}.";mysql_socket=".$CONFIG->{"MYSQL"}{"socket"} + $dbistring = "DBI:mysql:database=".$CONFIG->{"MYSQL"}{$db_name}.";mysql_socket=".$CONFIG->{"MYSQL"}{"socket"} } else { - $dbi = "DBI:mysql:".$CONFIG->{"MYSQL"}{$db_name}.":".$CONFIG->{"MYSQL"}{"host"}.":".$CONFIG->{"MYSQL"}{"port"} + $dbistring = "DBI:mysql:".$CONFIG->{"MYSQL"}{$db_name}.":".$CONFIG->{"MYSQL"}{"host"}.":".$CONFIG->{"MYSQL"}{"port"} } my $db = DBI->connect($dbistring, $CONFIG->{"MYSQL"}{"user"}, $CONFIG->{"MYSQL"}{"password"}); return $db; diff --git a/scripts/homer_mysql_rotate.pl b/scripts/homer_mysql_rotate.pl index 2557aa2..f16c006 100755 --- a/scripts/homer_mysql_rotate.pl +++ b/scripts/homer_mysql_rotate.pl @@ -209,9 +209,9 @@ sub db_connect { my $db_name = shift; my $dbistring = ""; if($CONFIG->{"MYSQL"}{"usesocket"}) { - $dbi = "DBI:mysql:database=".$CONFIG->{"MYSQL"}{$db_name}.";mysql_socket=".$CONFIG->{"MYSQL"}{"socket"} + $dbistring = "DBI:mysql:database=".$CONFIG->{"MYSQL"}{$db_name}.";mysql_socket=".$CONFIG->{"MYSQL"}{"socket"} } else { - $dbi = "DBI:mysql:".$CONFIG->{"MYSQL"}{$db_name}.":".$CONFIG->{"MYSQL"}{"host"}.":".$CONFIG->{"MYSQL"}{"port"} + $dbistring = "DBI:mysql:".$CONFIG->{"MYSQL"}{$db_name}.":".$CONFIG->{"MYSQL"}{"host"}.":".$CONFIG->{"MYSQL"}{"port"} } my $db = DBI->connect($dbistring, $CONFIG->{"MYSQL"}{"user"}, $CONFIG->{"MYSQL"}{"password"}); return $db;