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 database schema to initialize the Tigase server database space. First, switch to the database you have just created:

    mysql> use tigasedb;

    Assuming you run the mysql client in Linux from the Tigase installation directory. If you run the Tigase server all versions below 4.0:

    mysql> source database/mysql-schema.sql;

    For the Tigase server version 4.x you have to use proper schema version:

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

    On Windows you have probably to enter the full path:

    mysql> source c:/Program Files/Tigase/database/mysql-schema.sql;

    The initialization schema file should be also available locally in database/ directory of your Tigase installation.