Download PDF file
Transcript
18
Wydawca
}
Then, the /etc/wydawca.mysql would contain the actual parameters for
accessing the database, e.g.:
[wydawca]
socket = /var/db/mysql.sock
database = savane
user = savane
pass = guessme
Another way to specify database credentials is by using the statements
described below. If you prefer this way, you will have to tighten the permissions of wydawca.rc so that no third person could see the SQL password.
The recommended permissions are ‘0600’.
host hostname[:port-or-socket]
[Config: sql]
Set the hostname or IP address of the host running the database. Optional
port-or-socket specifies port number (for TCP connections) or socket
name (for UNIX sockets) to use. In the latter case, the hostname and the
colon may be omitted. If, however, it is present, it must be ‘localhost’.
database name
[Config: sql]
Specifies the database name.
user name
[Config: sql]
Sets the database user name.
password string
[Config: sql]
Sets the password for accessing the database.
ssl-ca file
[Config: sql]
Sets the pathname to the certificate authority file, if you wish to use a
secure connection to the server via SSL.
An example sql statement follows:
sql default {
host project.database.com:3306;
database savane;
user root;
password guessme;
}
It is possible to combine both methods, e.g.:
sql default {
config-file /etc/wydawca.sql;
host project.database.com:3306;
database savane;
}
Then, wydawca will attempt to obtain the missing information (username
and password, in this case) from the /etc/wydawca.sql file.