View | Details | Raw Unified | Return to bug 11974
Collapse All | Expand All

(-)a/C4/Context.pm (-3 / +16 lines)
Lines 806-814 sub _new_dbh Link Here
806
    my $db_port   = $context->config("port") || '';
806
    my $db_port   = $context->config("port") || '';
807
    my $db_user   = $context->config("user");
807
    my $db_user   = $context->config("user");
808
    my $db_passwd = $context->config("pass");
808
    my $db_passwd = $context->config("pass");
809
    # MJR added or die here, as we can't work without dbh
809
    my $db_mysql_socket   = $context->config("mysql_socket") || '';
810
    my $dbh = DBI->connect("DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",
810
	
811
    $db_user, $db_passwd, {'RaiseError' => $ENV{DEBUG}?1:0 }) or die $DBI::errstr;
811
    my $dbh;
812
    #if a unix socket is given use that instead of TCP (as it is way faster!) ONLY Mysql-derivatives
813
    # Instead of dying, just warn about the error because we can fall back to a TCP-connection.
814
    if ($db_mysql_socket && ($db_driver =~ /mysql/i || $db_driver =~ /mariadb/i)) { 
815
            # MJR added or die here, as we can't work without dbh
816
            $dbh = DBI->connect("DBI:$db_driver:dbname=$db_name;mysql_socket=$db_mysql_socket",
817
                $db_user, $db_passwd, {'RaiseError' => $ENV{DEBUG}?1:0 }) or warn $DBI::errstr;
818
    }
819
    #Try making a TCP connection
820
    if ((! defined ($dbh))  &&  $db_host) {
821
        # MJR added or die here, as we can't work without dbh
822
        $dbh = DBI->connect("DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",
823
            $db_user, $db_passwd, {'RaiseError' => $ENV{DEBUG}?1:0 }) or die $DBI::errstr;
824
    }
812
825
813
    # Check for the existence of a systempreference table; if we don't have this, we don't
826
    # Check for the existence of a systempreference table; if we don't have this, we don't
814
    # have a valid database and should not set RaiseError in order to allow the installer
827
    # have a valid database and should not set RaiseError in order to allow the installer
(-)a/etc/koha-conf.xml (-1 / +1 lines)
Lines 271-276 __PAZPAR2_TOGGLE_XML_POST__ Link Here
271
 <database>__DB_NAME__</database>
271
 <database>__DB_NAME__</database>
272
 <hostname>__DB_HOST__</hostname>
272
 <hostname>__DB_HOST__</hostname>
273
 <port>__DB_PORT__</port>
273
 <port>__DB_PORT__</port>
274
<!-- <mysql_socket>__put your non-default mysql/mariadb socket path here. eg /tmp/mysqld.sock__</mysql_socket> -->
274
 <user>__DB_USER__</user>
275
 <user>__DB_USER__</user>
275
 <pass>__DB_PASS__</pass>
276
 <pass>__DB_PASS__</pass>
276
 <biblioserver>biblios</biblioserver>
277
 <biblioserver>biblios</biblioserver>
277
- 

Return to bug 11974