This chapter contains general notes about database configuration and basic instructions for creating the database using the standard command line tools. If you use a different tool for managing the databases, refer to the relevant documentation for more information.
You can use an existing database instead of creating a new one. Just ensure that the tables used by the WebIssues Server have a unique prefix to avoid clashes with other tables. This way you can also install multiple instances of the server sharing a single database.
The database user used by the WebIssues Server to login to the database must have sufficient privileges to create tables. The simplest solution for MySQL is to grant ALL PRIVILEGES to the database; for PostgreSQL and SQL Server assign the user to the database owner role. Refer to the database documentation for more information about privileges.
Note
WebIssues uses the Unicode standard to store all text. If you use PostgreSQL, you must create the database with UNICODE encoding selected. If you use MySQL version 4.1 or later or SQL Server, WebIssues will automatically use the appropriate encoding.
If you use MySQL 4.0 or earlier, text is stored using the UTF-8 encoding even though the database doesn't support it, so Unicode characters will be seen as sequences of bytes. This may lead to problems when accessing the database from other applications and when transferring or upgrading the database. You may find instructions for upgrading the MySQL database from version 4.0 or earlier in the MySQL manual.
-
Create the database (
dbauseris the login of the database administrator,databaseis the name of the database to create):mysqladmin -u
dbauser-p createdatabaseYou will be prompted for the database administrator's password.
-
Connect to the database server:
mysql -u
dbauser-p -
From the MySQL command prompt execute the following query to create a user with access to the database (
useris the user's login,passwordis the user's password anddatabaseis the name of the database):GRANT ALL PRIVILEGES ON
database.* TO 'user'@'localhost' IDENTIFIED BY 'password'; -
Execute the following query to activate the new permissions:
FLUSH PRIVILEGES;
-
Create the user account (
useris the user's login):createuser --pwprompt --encrypted --no-adduser --no-createdb
userYou will be prompted for the password for the new user. Note that you have to log in as a user with appropriate permissions to manage the PostgreSQL server.
-
Create the database (
useris the user's login,databaseis the name of the database to create):createdb --encoding=UNICODE --owner=
userdatabase
-
Connect to the database server:
sqlcmd.exe -U
dbauser-PdbapasswordUse osql.exe instead if you have SQL Server 2000. Replace
dbauseranddbapasswordwith the login and password of the database administrator. -
Execute the following queries to create a user's login and the database (
useris the user's login,passwordis the user's password anddatabaseis the name of the database to create):CREATE LOGIN
userWITH PASSWORD = 'password';
GO
CREATE DATABASEdatabase;
GO -
Execute the following queries to assign appropriate permissions for the database to the user (
useris the user's login,databaseis the name of the database):USE
database;
GO
EXEC sp_grantdbaccess 'user';
GO
EXEC sp_addrolemember 'db_owner', 'user';
GO
-
Create a user account for connecting to the database (
useris the user's login,passwordis the user's password):gsec -user sysdba -password
masterkey
GSEC>adduser-pwpassword
GSEC>quitUse the appropriate administrator's password instead of
masterkey. -
Create the database (
/path/to/database.fdbis the path of the database file,useris the user's login andpasswordis the user's password):isql
SQL>create database '/path/to/database.fdb'
CON>user 'user' password 'password'
CON>page_size 16384
CON>default character set UTF8;
SQL>quit;Note that you may need to set approprate permissions for the database file so that it's accessible for the Firebird server. Refer to Firebird documentation for more details.
Copyright © 2007-2009 WebIssues Team