Install Database

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

On your database-host, while logged in as root:

  1. Install the MySQL server and client packages. For example, on a Debian-based Linux distribution:

    # apt-get install mysql-server mysql-client

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

  2. Log in to the system and create a database for the Content Engine:

    # 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.

  3. If you are installing everything on a single host or if you created a shared file system as described in Create Shared File System, then you should have direct access to the Content Engine package you downloaded earlier (see Download Content Engine). If not, you will need to copy it to some temporary location on the database-host.

  4. Change user to escenic and unpack the Content Engine package to a temporary location:

    # su - escenic
    $ cd /tmp
    $ unzip /mnt/download/engine-5.3.10.154952.zip
  5. Still as the escenic user, run the Content Engine's database scripts:

    $ cd /tmp/engine-5.3.10.154952/database/mysql/
    $ for el in tables.sql indexes.sql constants.sql constraints.sql; do
    > mysql -u user -ppassword db-name < $el
    > done;

    Replace db-name, user and password in the above commands with the names you chose in step 2.

  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 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 = database-host-ip-address

You should then 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 database-host 3306

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

On a single-host installation, you can check that MySQL is running by entering the following command:

$ mysqladmin -u root -p status

You should get a response something like this:

Uptime: 605 Threads: 1 Questions: 615 Slow queries: 0 Opens: 842 Flush tables: 1 Open tables: 40 Queries per second avg: 1.16

If the server is not running then you will see an error reporting that it was not possible to connect to the server.