[Other doc versions]
This page describes how to connect Stash to a MySQL database.
MySQL 5.6.x Compatibility
See Supported platforms for the versions of MySQL supported by Stash.
The overall process for using a MySQL database with Stash is:
It is assumed here that you already have MySQL installed and running. MySQL documentation is available at http://dev.mysql.com/doc/.
The JDBC drivers for MySQL are not bundled with Stash (due to licensing restrictions). You need to download and install the driver yourself.
<Stash home directory>/libdirectory (for Stash 2.1 or later).
If you are migrating your data from the internal Stash database, back up the Stash home directory.
If you are migrating your Stash data from another external database, back up that database by following the instructions provided by the database vendor before proceeding with these instructions.
Before you can use Stash with MySQL, you must set up MySQL as follows:
utf8character set encoding. (Note that Stash on MySQL does not support 4 byte UTF-8 characters.)
utf8_bincollation (to ensure case sensitivity)
ROW. Refer to the MySQL documentation. Note that Stash sets the MySQL transaction isolation level to
READ-COMMITTEDwhen it connects to the database.
Here is an example of how to do that. When Stash and MySQL run on the same physical computer (accessible through
localhost), run the following commands (replacing
password with your own values):
This creates an empty MySQL database with the name
stash, and a user that can log in from the host that Stash is running on who has full access to the newly created database. In particular, the user should be allowed to create and drop tables, indexes and other constraints.
If the MySQL database and Stash servers are on the same physical computer, you can use
localhost and not set a password by omitting
IDENTIFIED BY 'password' from the 2nd MySQL statement above (if you trust the security within this computer).
If the MySQL database and Stash servers are on different computers, just replace the
localhost part of the GRANT ALL statement above with the hostname of the machine that Stash is running on. See the documentation at http://dev.mysql.com/doc/refman/5.1/en/account-names.html.
Note that Stash will generally require about 25–30 connections to the database.
You can now connect Stash to the MySQL database, either:
The host name or IP address of the computer running the database server.
|Port||The TCP port with which Stash can connect to the database server. The default value is the default port that MySQL runs against. You can change that if you know the port that your MySQL instance is using.|
|Database name||The name of the database that Stash should connect to.|
|Database username||The username that Stash should use to access the database.|
|Database password||The password that Stash should use to access the database.|