mnoGoSearch 3.2.33 reference manual: Full-featured search engine software
Prev |  | Next

# DBAddr

## Name

DBAddr -- sets database address

indexer.conf search.htm searchd.conf

## Synopsis

DBAddr {{DBType}:[//[DBUser[:DBPass]@]DBHost[:DBPort]]/DBName/[?dbmode=mode]}

## Description

This command defines URL-style database address.

Type, host, database name, port, user and password are options to connect to SQL database.

Must be used before any other commands. Has global effect on the whole configuration file.

ODBC notes: Use DBName to specify ODBC Data Source Name (DSN) DBHost does not matter, so use "localhost".

Currently supported DBType values are mysql, pgsql, mssql, sybase, oracle, ibase, db2, mimer, sqlite, cache.

If you are using PostgreSQL and do not specify hostname, e.g.

    pgsql://user:password@/dbname/

mnoGoSearch will communicate with PostgreSQL not via TCP, but using a Unix socket.

MySQL and PostgreSQL users can specify path to Unix socket when connecting to localhost:

    DBAddr mysql://foo:bar@localhost/mnogosearch/?socket=/tmp/mysql.sock
    DBAddr pgsql://foo:bar@/mnogosearch/?socket=/tmp/s.PGSQL.5432

MySQL users can specify whether to switch MySQL query logging on/off using sqllog parameter:

    DBAddr mysql://foo:bar@localhost/mnogosearch/?sqllog=0
    DBAddr mysql://foo:bar@localhost/mnogosearch/?sqllog=1

If sqllog parameter is given, then mnoGoSearch will send "SET SQL_LOG_OFF=X" query on connection time.

Mode is "single", "multi" or "blob". Default mode is "single". Note: "blob" works with MySQL only and must be used in search.htm or searchd.conf only.

Some special characters, if they appear as a password part, need to be escaped using %XX notation, where XX is a hex code. Use %3A for ":", %3B for ";", %3C for "<", %3D for "=", %3E for ">", %3F for "?" and %40 for "@" characters. For example,

    DBAddr pgsql://user:pwd%3Awith%40special%3Cchars@/search/

corresponds to the local PostgreSQL database "search" with user name "user" and password "pwd:with@special<chars".

## Examples

    DBAddr mysql://foo:bar@localhost/mnogosearch/?dbmode=multi
    DBAddr mysql://foo:pwd%3Awith%40special%3Cchars@localhost/mnogosearch/

Prev | Home | Next
DateFormat | Up | DefaultLang