6.4.1 MySQL Configuration

The SQL database is configured using the following options:

config-file=file

Set the name of the MySQL configuration file to read. By default ‘/etc/my.cnf’ is used.

config-group=name

Set the name of the group in the MySQL configuration file, from where to read the configuration options.

The statements above allow to keep all security-sensitive information, such as MySQL username and password, in an external configuration file and thus to relax permission requirements for ‘smapd.conf’. For a detailed description of the format of such external configuration file (or option file in ‘MySQL’ parlance), see MySQL option files.

In case the use of option files is not feasible for some reason, you may specify MySQL connection and database parameters in ‘smapd.conf’ when loading the mysql module or defining a smap database. The following options are used to define MySQL connection parameters:

host=hostname

Sets the hostname or IP address of the host running the MySQL server.

port=n

Sets port number the MySQL server is listening on. Default is 3306.

socket=file

Sets the socket name, if the server is listening on a UNIX socket.

ssl-ca=file

Sets the pathname to the certificate authority file, if you wish to use a secure connection to the server via SSL.

Notice, that either ‘host’ and, optionally, ‘port’ or ‘socket’ must be used. Specifying both is senseless.

MySQL database and user credentials are defined using the following options:

database=name

Sets the name of the MySQL database to use.

user=name

Sets MySQL user name.

password=string

Sets the password for accessing the MySQL database.

When using these options, it is reasonable to tighten the permissions on ‘smapd.conf’ so that no third person could see the MySQL password. The recommended permissions are ‘0600’.