Skip to content
gschueler edited this page Jan 3, 2013 · 2 revisions

Mysql setup guide

This is a simple guide for setting up Mysql for use with Rundeck.

Install Mysql

You can "yum install" or "apt-get install" the server, or you can download rpms manually if you like. See mysql linux installation

After install, run the mysql_secure_installation script. This will let prompt you to set the root password for mysql, as well as disable anonymous access.

Setup Rundeck Database

Now you want to create a database and user access for the Rundeck server.

If it is not running, start mysqld with "service mysqld start"

Use the 'mysql' commandline tool to access the db as the root user:

$ mysql -u root -p

Enter your root password to connect. Once you have the mysql> prompt, enter the following commands to create the rundeck database:

mysql> create database rundeck;
Query OK, 1 row affected (0.00 sec)

Then "grant" access for a new user/password, and specify the hostname the Rundeck server will connect from. if it is the same server, you can use "localhost".

mysql> grant ALL on rundeck.* to 'rundeckuser'@'localhost' identified by 'rundeckpassword';
Query OK, 1 row affected (0.00 sec)

You can then exit the mysql prompt.

Test access (if it's from localhost) by running:

$ mysql -u rundeckuser -p

You can verify you can see the "rundeck" database with:

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| rundeck            |
+--------------------+
2 rows in set (0.00 sec)

Configure Rundeck

Now you need to configure Rundeck to connect to this DB as described in the Rundeck Docs:

Update your rundeck-config.properties and configure the datasource:

dataSource.url = jdbc:mysql://myserver/rundeck?autoReconnect=true
dataSource.username=rundeckuser
dataSource.password=rundeckpassword

# needed for Rundeck 1.4
rundeck.v14.rdbsupport=true

Next, Download the mysql connector jar.

Copy the mysql-connector-java-5.x.x-bin.jar to $RDECK_BASE/server/lib

Finally you can start rundeck. If you see a startup error about database access, make sure that the hostname that the Mysql server sees from the client is the same one you granted access to.