Mini SQL 2.0 (Beta) Standard Programs and UtilitiesIntroduction
mSQL 1.x offered several configuration options, including such details as the user the server should run as, the location of the TCP and UNIX sockets for client/server communications, the location of the database files etc. The problem with configuring mSQL 1.x was that all these details were hard-coded into the software at compile time. Once the software was compiled and installed you couldn't easily change those settings.
To overcome this problem, mSQL 2.0 utilises an external run-time configuration file for definition of all these values. The file is called msql.conf and is located in the installation directory (usually /usr/local/Hughes). An application can choose to use a different configuration file by calling the new msqlLoadConfigFile( ) API function. All standard mSQL applications and utilities provide a command line flag, -f ConfFile , that allows you to specify a non-standard configuration file. When an application first calls the mSQL API library, a check is made to see if a configuration file has been loaded via a call to the msqlLoadConfigFile( ) function. If no such call has been made, the API library loads the default config file. Any values that are specified in that file will over-ride the normal operating paramaters used by mSQL.
The configuration file is a plain text file organised into sections. The file can contain blank lines and comments. A comment is a line that begins with the '#' character. Each section of the configuration file has a section header, which is written as the section name enclosed in square brackets (for example [ general ]). Currently the only section defined is the general section although further sections covering security and access control will be added later.
Configuration values within a section are presented using the config parameter name followed by and equals sign and then the new value. There can only be one entry per line and if an entry is defined multiple times in the one config file the last value defined will be used. If a parameter is not defined in the config file then an internal default value will be used at run-time.
The following configuration parameters are available in the general section of the config file. Please note that %I may be used in configuration entries to signify the mSQL installation directory (e.g. /usr/local/Hughes).
Parameter
Default Value
Definition
Below is a sample configuration file. This file does not achieve anything as it just sets the parameters to their default values.
# # msql.conf - Configuration file for Mini SQL Version 2 # #-------------------------------------------------------------- # # This file is an example configuration and may require # modification to suit your needs or your site. The values # given are the default values and will be used by the # software if either this file is missing or a specific value # is not specified. # #-------------------------------------------------------------- [general] Inst_Dir = /usr/local/Hughes mSQL_User = msql Admin_User = root Pid_File = %I/msql2.pid TCP_Port = 1114 UNIX_Port = %I/msql2.sock