Install Database

For test and development purposes you can skip the steps in this section: all forum-related data will then be stored in your main Content Engine database. For a production system, you are strongly recommended to create a separate database for your forum data, located on a separate host. This section describes how to do that.

The following instructions describe how to install and set up MySQL for use by the Forum plugin.

  1. Log in as root on your forum-database-host.

  2. Install the MySQL server and client packages:

    # apt-get install mysql-server mysql-client

    During the installation you will be asked to specify a root password for the database.

  3. Log in to the system and create a database:

    # mysql -p
    mysql> create database db-name character set utf8 collate utf8_general_ci;
    Query OK, 1 row affected (0.00 sec)
    
    mysql> grant all on db-name.* to user@'%' identified by 'password';
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> grant all on db-name.* to user@'localhost' identified by 'password';
    Query OK, 0 rows affected (0.00 sec)
    mysql> exit

    Replace db-name, user and password in the above commands with a database name, user name and password of your choice. db-name must, of course be different from the name of your main Content Engine database.

  4. Still on your forum-database-host, change user to escenic.

  5. You now need to run the Forum database scripts. If you have a single-host installation, then you will find them in /opt/escenic/plugins/forum/misc/database/mysql. If you have a multi-host installation with shared folders, then you have direct access to the distribution file and can just unpack it to a temporary location as follows:

    $ cd /tmp
    $ unzip /mnt/download/forum-3.1.0.123741.zip

    You will then find the scripts in /tmp/forum/misc/database/mysql. If you don't have a shared folder set-up then you can either download the package from Escenic Technet again and unpack it, or copy the scripts over from your assembly-host.

    Once you have located the scripts, you can run them as follows:

    $ cd script-folder
    $ for el in tables.sql constraints.sql indexes.sql; do
    > mysql -u user -ppassword db-name < $el
    > done;

    where script-folder is the path of the folder containing the scripts.

  6. On some platforms, external access to the MySQL server is disabled by default. To enable external access, you need to bind the mysql process to the forum-database-host's IP address. To do this, you need to open /etc/mysql/my.cnf for editing (as root again) and set the bind-address parameter:

    bind-address = forum-database-host-ip-address
  7. Verify that the MySQL server is running and accessible by trying to connect to port 3306 from each of your other hosts using telnet:

    $ telnet forum-database-host 3306

    where forum-database-host is the host name or IP address of the forum-database-host. If a connection is opened, then the database server is running and accessible.