This documentation relates to the latest version of Confluence.
If you are using an earlier version, please go to the documentation home page and select the relevant version.
Use this guide in conjunction with the more general Database Setup Guide for Any Database. These instructions add some reference notes specific to SQL Server.
Identify Character Encoding
To identify which character encoding to use, check the encoding used by your application server and Confluence now. All three must use compatible encoding. For example, the default SQL Server encoding of USC-2 is compatible with UTF-8.
Create Database
As an SQL administrator, create a new database. If you set your application server and Confluence to use an encoding incompatible with USC-2, specify that character encoding for the database.
Create SQL User Account
As an SQL administrator, create a new user account for Confluence. Provide full create, read and write permissions for the table. Note that Confluence must be able to create its own schema.
Install Database Drivers
SQL Server users are strongly recommended to install the jTDS JDBC drivers.
If using direct JDBC connection, copy the driver file jtds-<version>.jar into your standalone's <confluence install>/confluence/WEB-INF/lib directory.
If you are configuring a datasource to connect to your MS SQL server database, you will need to place the jar file in <confluence install>/lib (for Confluence 2.10 onwards) or <confluence install>/common/lib (for earlier versions). You may find this page helpful: http://jtds.sourceforge.net/faq.html
Start Confluence and visit the home URL (eg http://localhost:8080) to start the Confluence Setup Wizard and select a Custom Install, insert the relevant connection information.
When prompted for a driver class name in the database setup step enter:
net.sourceforge.jtds.jdbc.Driver
When prompted for the jdbc url, the format to use is:
Confluence also reports a hibernate database error (connection could not be esta...
Confluence also reports a hibernate database error (connection could not be established) if your data folder in the first step is not configured properly.
Ensure that your data folder specified in [Confluence\confluence\WEB-INF\classes\confluence-init.properties] uses forward slashes (windows), and does NOT point to the /Confluence/confluence/data directory, instead create a data directory in the root:
confluence.home=C:/IRC/Java/Confluence/data
This was not easy to track down.
From our testing, Confluence works using SQL Server 2005, there should be no changes to SQL server 2005 necessary (but do ensure that tcp/ip is enabled, and if communicating web->db with the same box use port 1433, else if communicating web->db to another box, use port 1434)
In summary, use the instance port number in place of 1433/1434.
eg.
jdbc:jtds:sqlserver://localhost:1100/<database>
You can find out which port your named instance is using by going to
Enterprise Manager > Select <database>\<instance name> > Properties > General > Network Configuration > TCP/IP > Properties > (should be 1100+)
(If you're trying to bind to an existing confluence installation, delete your [\Confluence\data\confluence.cfg.xml] file, and restart setup.)
I was only able to make this work with a SQL Server user; I could never get a Wi...
I was only able to make this work with a SQL Server user; I could never get a Windows user to work. Perhaps this is implied by requiring mixed-mode, but maybe my observation will save someone else some time.
The standalone download of Confluence has a common/lib off of the ${confluenceho...
The standalone download of Confluence has a common/lib off of the ${confluencehome} directory. But the EAR/WAR version doesn't. So where to put the jtds-<version>.jar in the EAR/WAR version?
Answer: If you installed the Tomcat 5.5 server, the jtds-<version>.jar goes in the Tomcat installdir/common/lib. Under Windows this might be C:\Program Files\Apache Software Foundation\apache-tomcat-5.5.23\common\lib
one thing is not clear to me is how jdbc provider & data source are configur...
one thing is not clear to me is how jdbc provider & data source are configured for jtds driver under IBM WebSphere 6.1.x rel.? Has anyone try to make it work under User-Defined...?
In step #3 above "Create Database Table", it should be "Create Database". The JI...
In step #3 above "Create Database Table", it should be "Create Database". The JIRA instructions for connecting JIRA to SQL Server is clearer. See http://www.atlassian.com/software/jira/docs/latest/databases/sqlserver.html. I adapted the 3 steps as they apply to Confluence too. These 3 steps covers the steps 3 and 4 documented above.
Create a database user which Confluence will connect as (e.g. confluenceuser). Note that confluenceuser should not be the database owner, but should be in the db_owner role. (See SQL Startup Errors for details.)
Create a database for confluence to store issues in (e.g. confluencedb).
Ensure that the user has permission to connect to the database, and create and populate tables.
Setting it up with the Microsoft JDBC driver and Integrated Security
(We did th...
Setting it up with the Microsoft JDBC driver and Integrated Security
(We did this after an initial setup using the default jTDS driver and standard auth)
(for weasels) Backup database and configuration
Download Microsoft SQL Server JDBC driver from MSDN and extract it to a temp directory
Copy sqljdbc.jar to <confluence-install-dir>\common\lib
Create or add to CLASSPATH system environment variable ".;<confluence-install-dir>\common\lib\sqljdbc.jar"
Copy x86\sqljdbc_auth.dll to <confluence-install-dir>\bin
Create service account in the Windows domain as a Domain Guest
Add this service account to the local Administrators group on the Confluence application server (i'm lazy)
Make the service account member of the db_owner role for the Confluence database on the SQL Server
Configure the Apache Tomcat Confluence service to run under the service account using the Services admin tool. (use account@domain notation, nor DOMAIN\account)
Update <confluence-home>\confluence.cfg.xml to use Microsoft JDBC driver instead of sourceforge jtds driver. Replace CONFSERVER:1433 to point to the existing SQL Server instance (see extract below)
Note that the username and password in the config file are actually ignored. The driver will use the credentials of the Service process that was set before using the Services admin tool.
This setup seems to work without problems and makes the SQL Server dba happy as he can use the safer "Integrated Mode" setting on SQL Server and the database password is no longer exposed in the config file.
Make the service account member of the db_owner role for the Confluence databa...
Make the service account member of the db_owner role for the Confluence database on the SQL ServerHow do I do this? I can“t find my newly created service account. Im using the SQL Server 2005 managment console (GUI)
This page indicates that Confluence must be able to create its own schema. ...
This page indicates that Confluence must be able to create its own schema. However, in the instructions for any database setup , the documentation says that I should create the schema myself. Which is it?
Hi,
You do not need to create your own schema. Confluence will create a default...
Hi,
You do not need to create your own schema. Confluence will create a default schema in SQL server which is dbo. What you only need to do is creating database which is accessible by Confluence to fill in the data inside the database. Please ensure that Confluence has enough privileges to modify your database and please ensure that you use the correct collation (case insensitive).
Enable "VIA" under "SQL Server Network Configuration" and "Protocols for DATABASE_NAME"
Enable TCP/IP in the same location. Under the IP Adresses tab, you will need to add "1433" for all of the "TCP Port" fields and remove any value set for "TCP Dynamic Port"
Comments (12)
Dec 19, 2005
Dev says:
Confluence also reports a hibernate database error (connection could not be esta...Confluence also reports a hibernate database error (connection could not be established) if your data folder in the first step is not configured properly.
Ensure that your data folder specified in [Confluence\confluence\WEB-INF\classes\confluence-init.properties] uses forward slashes (windows), and does NOT point to the /Confluence/confluence/data directory, instead create a data directory in the root:
confluence.home=C:/IRC/Java/Confluence/data
This was not easy to track down.
From our testing, Confluence works using SQL Server 2005, there should be no changes to SQL server 2005 necessary (but do ensure that tcp/ip is enabled, and if communicating web->db with the same box use port 1433, else if communicating web->db to another box, use port 1434)
Dec 21, 2005
David Loeng says:
We have added a note/warning about the slashes to confluence-init.properties to ...We have added a note/warning about the slashes to confluence-init.properties to make this clearer.
Jan 24, 2006
Dev says:
Using confluence with sql server 2000/2005 with named instances (eg: INSTANCE01)...Using confluence with sql server 2000/2005 with named instances (eg: INSTANCE01):
http://jtds.sourceforge.net/faq.html#instanceName http://www.eggheadcafe.com/ng/microsoft.public.sqlserver.jdbcdriver/post21039344.asp
In summary, use the instance port number in place of 1433/1434.
eg.
jdbc:jtds:sqlserver://localhost:1100/<database>You can find out which port your named instance is using by going to
Enterprise Manager > Select <database>\<instance name> > Properties > General > Network Configuration > TCP/IP > Properties > (should be 1100+)
(If you're trying to bind to an existing confluence installation, delete your [\Confluence\data\confluence.cfg.xml] file, and restart setup.)
Nov 21, 2006
Scott Smith says:
I was only able to make this work with a SQL Server user; I could never get a Wi...I was only able to make this work with a SQL Server user; I could never get a Windows user to work. Perhaps this is implied by requiring mixed-mode, but maybe my observation will save someone else some time.
Apr 22, 2007
Garnet R. Chaney says:
The standalone download of Confluence has a common/lib off of the ${confluenceho...The standalone download of Confluence has a common/lib off of the ${confluencehome} directory. But the EAR/WAR version doesn't. So where to put the jtds-<version>.jar in the EAR/WAR version?
Answer: If you installed the Tomcat 5.5 server, the jtds-<version>.jar goes in the Tomcat installdir/common/lib. Under Windows this might be C:\Program Files\Apache Software Foundation\apache-tomcat-5.5.23\common\lib
May 14, 2008
Anonymous says:
one thing is not clear to me is how jdbc provider & data source are configur...one thing is not clear to me is how jdbc provider & data source are configured for jtds driver under IBM WebSphere 6.1.x rel.? Has anyone try to make it work under User-Defined...?
Jun 27, 2007
Francis Lau says:
In step #3 above "Create Database Table", it should be "Create Database". The JI...In step #3 above "Create Database Table", it should be "Create Database". The JIRA instructions for connecting JIRA to SQL Server is clearer. See http://www.atlassian.com/software/jira/docs/latest/databases/sqlserver.html. I adapted the 3 steps as they apply to Confluence too. These 3 steps covers the steps 3 and 4 documented above.
Feb 15, 2008
Maarten Sikkema says:
Setting it up with the Microsoft JDBC driver and Integrated Security (We did th...Setting it up with the Microsoft JDBC driver and Integrated Security
(We did this after an initial setup using the default jTDS driver and standard auth)
Note that the username and password in the config file are actually ignored. The driver will use the credentials of the Service process that was set before using the Services admin tool.
This setup seems to work without problems and makes the SQL Server dba happy as he can use the safer "Integrated Mode" setting on SQL Server and the database password is no longer exposed in the config file.
Jun 23, 2008
Anonymous says:
Make the service account member of the db_owner role for the Confluence databa...Sep 10, 2008
Anonymous says:
This page indicates that Confluence must be able to create its own schema. ...This page indicates that Confluence must be able to create its own schema. However, in the instructions for any database setup , the documentation says that I should create the schema myself. Which is it?
Sep 19, 2008
Arie Murdianto says:
Hi, You do not need to create your own schema. Confluence will create a default...Hi,
You do not need to create your own schema. Confluence will create a default schema in SQL server which is dbo. What you only need to do is creating database which is accessible by Confluence to fill in the data inside the database. Please ensure that Confluence has enough privileges to modify your database and please ensure that you use the correct collation (case insensitive).
Cheers,
Apr 23
Tony Atkins [Atlassian] says:
In addition to the steps above regarding named instances, you can also set up SQ...In addition to the steps above regarding named instances, you can also set up SQL Server to listen on the standard port as follows:
Add Comment