Install Database
The following instructions describe how to install and set up MariaDB for use by the Content Store.
On your database-host, while logged in as
root
:
-
Install the MariaDB server and client packages. For example, on a Debian-based Linux distribution:
#
apt-get install mariadb-server mariadb-client -
Log in to the system and create a database for the Content Store:
#
mysql -pmysql>
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>
exitReplace db-name, user and password in the above commands with a database name, user name and password of your choice.
-
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 Store package you downloaded earlier. If not, you will need to copy it to some temporary location on the database-host.
-
Change user to
escenic
and unpack the Content Store package to a temporary location:#
su - escenic$
cd /tmp$
unzip /mnt/download/engine-7.0.2-2.zip -
Still as the
escenic
user, run the Content Store's database scripts:$
cd /tmp/engine-7.0.2-2/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. Your password must immediately follow the
-p
switch, with no intervening space (as shown above). -
On some platforms, external access to the MariaDB 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 (asroot
again) and set thebind-address
parameter:bind-address = database-host-ip-address
You should then verify that the MariaDB 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 MariaDB 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.