Basic Setup

The MySQL database can be prepared in many ways. Most Linux distributions contain tools which allow you to go through all steps from the shell command line. To make sure it works on all platforms in the same way, we will first show how to do it under MySQL command line client.

Configuring from MySQL command line tool

Run the MySQL command line client in either Linux or MS Windows environment and enter following instructions:

  1. Create the database for the Tigase server:

    mysql> create database tigasedb;
  2. Add the tigase_user user and grant him access to the tigasedb database. Depending on how you plan to connect to the database (locally or over the network) use one of following commands or all if you are not sure:

    Grant access to tigase_user connecting from any network address.

    mysql> GRANT ALL ON tigasedb.* TO tigase_user@'%'
                IDENTIFIED BY 'tigase_passwd';

    Grant access to tigase_user connecting from localhost.

    mysql> GRANT ALL ON tigasedb.* TO tigase_user@'localhost'
                IDENTIFIED BY 'tigase_passwd';

    Grant access to tigase_user connecting from local machine only.

    mysql> GRANT ALL ON tigasedb.* TO tigase_user
                IDENTIFIED BY 'tigase_passwd';

    For the Tigase server version 4.x additional permissions must be granted for the database user:

    mysql> GRANT SELECT, INSERT, UPDATE ON mysql.proc TO 'tigase_user'@'localhost';
    mysql> GRANT SELECT, INSERT, UPDATE ON mysql.proc TO 'tigase_user'@'%';
    mysql> GRANT SELECT, INSERT, UPDATE ON mysql.proc TO 'tigase_user';

    And now you can update user permission changes in the database:

    mysql> FLUSH PRIVILEGES;
  3. Load the proper mysql schema into the database. Full installations of Tigase will have all the SQL file you need to create and update the database. First, switch to the database you have just created:

    mysql> use tigasedb;

    We are assuming you run the mysql client in Linux from the Tigase installation directory.

    mysql> source database/mysql-7-1-schema.sql;

    For the Tigase server version v7.1.0 you have to use proper schema version which is 5.1. You will also need to manually load the PubSub schema as well, current version is v3.2.0. All modern versions will load previous schemas first so no need to do a manual upgrade.

    mysql> source database/mysql-pubsub-schema-3.2.0.sql;

    If you plan to use the Socks5 component, you will also need to add that schema as well.

    mysql> source database/mysql-socks5-schema.sql;

    On Windows you have probably to enter the full path, assuming Tigase is installed in C:\Program Files\Tigase:

    mysql> source c:/Program Files/Tigase/database/mysql-7-1-schema.sql;
    mysql> source c:/Program Files/Tigase/database/mysql-pubsub-schema-3.2.0.sql;
    mysql> source c:/Program Files/Tigase/database/mysql-socks5-schema.sql;