To use a MySQL or MariaDB database with the blueprint design server, before
you install the blueprint design server, install the database and provide the Java™ Database Connectivity (JDBC) JAR file for the
blueprint design server installation process.
MySQL and MariaDB are similar
databases. Which one you use depends on your operating system and version.
Before you begin
Before you install the blueprint design server, install the database. If you are evaluating
IBM UrbanCode Deploy,
you can install the database on the same system as the blueprint design server.
For example, the command to install MariaDB on a system that runs Red
Hat Enterprise Linux version 7 resembles the
following example:
yum install -y mariadb mariadb-server
To set the
database to run automatically and start the MariaDB database on a Linux system that uses
systemctl, run the
following
command:
systemctl enable mariadb; systemctl start mariadb
Note: The database
must be encoded in UTF-8.
Follow these steps to set the database encoding:
- On the system that hosts the database, open MySQL or MariaDB configuration file. The
location of the file depends on the operating system. On Linux, the file is named
my.cnf, and many distributions put the file in the folder
/etc or /etc/mysql. On Windows, the file is
named my.ini.
- In the [mysqld] section of the configuration file, add the following
lines:
character-set-server=utf8
character-set-filesystem=utf8
- Restart the database. For example, to restart MariaDB on Linux, use this
command:
systemctl restart mariadb
Procedure
- Open a command-line window and log in to the database as a user with table-creation
privileges. For example, run this command from the command
line:
mysql -u root
The command line shows a prompt that looks like this
example:MariaDB>
- Create a user for the blueprint design server to use and assign the user a password, as in the
following example command. This example creates a user that is named ibm_ucdp with the password as a
ibm_ucdp.
CREATE USER 'ibm_ucdp'@'localhost' IDENTIFIED BY 'password';
Remember this user name and password because you must have them when you install the blueprint
design server.
- Create a database for the blueprint design server, as in the following example command:
CREATE DATABASE ibm_ucdp;
- Grant permissions for the user to work with the database:
GRANT ALL ON ibm_ucdp.* TO 'ibm_ucdp'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
- Type quit to exit the database command line.
- Obtain the MySQL or MariaDB JDBC driver.
- Either note the location of the JDBC JAR file or place the file in the
installation_directory/ibm-ucd-patterns-install/web-install/media/server/opt/tomcat/lib
folder.
- Begin blueprint design server installation. See Installing the blueprint design server. When you are prompted for the database type,
enter mysql.
- Provide the JDBC driver class that the blueprint design server uses to connect to the
database. The default value is com.mysql.jdbc.Driver.
- Next, provide the JDBC connection string. Typically, it is similar to the following code:
jdbc:mysql://DB_URL:DB_PORT/DB_NAME
For example, the connection string to database that is on the same computer as the
blueprint design server and that uses the default port resembles the following code:jdbc:mysql://localhost:3306/ibm_ucdp
- Finish by entering the database user name and password.
Note: As of 7.0.2.0, UrbanCode Deploy uses Hibernate3, which released before MariaDB's inception. Due
to that, using BluePrint designer with UCD may result in the following error: Unable to
determine Dialect to use [name=MariaDB, majorVersion=5]; user must register resolver or explicitly
set 'hibernate.dialectThe following property can be added to
installed.properties:
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
MariaDB is a fork of MySQL and is designed to be drop-in compatible with MySQL.