Confluence 5.7 has reached end of life
Check out the [latest version] of the documentation
This page provides instructions for configuring Confluence to use the Microsoft SQL Server database.
Check the following before you start:
On this page:
Related pages:
If you do not already have an operational SQL Server database, download the installation package from the Microsoft SQL Server download page and follow the instructions on MSDN.
In this step you will create a database within SQL Server to hold your Confluence data, and a database user with authority to access that database. The database user should be in the db_owner role.
Set the default collation for the database to be 'SQL_Latin1_General_CP1_CS_AS' (case sensitive). You can do this by issuing the following SQL query:
ALTER DATABASE <database_name> COLLATE SQL_Latin1_General_CP1_CS_AS
Note: if you receive an error stating 'The database could not be exclusively locked to perform the operation', you may need to prevent other connections by setting the mode to single user for the transaction:
ALTER DATABASE <database_name> SET SINGLE_USER WITH ROLLBACK IMMEDIATE; <your ALTER DATABASE query> ALTER DATABASE <database_name> SET MULTI_USER;
Configure the database to use the isolation level, 'Read Committed with Row Versioning'. You can do this by issuing the following SQL query:
SELECT is_read_committed_snapshot_on FROM sys.databases WHERE name= 'YourDatabase'
Return value:
1 = READ_COMMITTED_SNAPSHOT option is ON. Read operations under the read-committed isolation level are based on snapshot scans and do not acquire locks.
0 = READ_COMMITTED_SNAPSHOT option is OFF (default). Read operations under the read-committed isolation level use share locks.
ALTER DATABASE <database_name> SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE;
confluenceuser). Give this user full create, read and write permissions for the database tables. Note that Confluence must be able to create its own schema.Decide whether you will set up a direct JDBC connection or a datasource connection to SQL Server, to suit your environment. If unsure, choose direct JDBC.
Install Confluence if you have not done so already. See the Confluence Installation Guide.
Start Confluence, and go to the Confluence Setup Wizard in your browser. Follow these steps to set up the new configuration:
When prompted for a Driver Class Name, enter the following:
net.sourceforge.jtds.jdbc.Driver
When prompted for the Database URL, use this format:
jdbc:jtds:sqlserver://<server>:<port>/<database>
If MS SQL is clustered, use this format:
jdbc:jtds:sqlserver://<server>:<port>/<database>;instance=<instance>
confluenceuser) and password you chose earlier.java:comp/env/jdbc/confluence
Congratulations! Confluence is now using your SQL Server database to store its data.
If you get the following error message, verify that you have given the confluenceuser user all the required database permissions when connecting from localhost.
Could not successfully test your database: : Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user 'confluenceuser'@'localhost' (using password: YES)'
<CONFLUENCE-INSTALLATION>/logs and <CONFLUENCE-HOME>/logs).