|
In this step, you will configure your MySQL database server.
Note: If you intend to connect Confluence to an existing MySQL database server, we strongly recommend that you reconfigure this database server by running through the configuration steps in the MySQL installation wizard as described below.
To configure MySQL Server:
my.cnf file (often named my.ini on Windows operating systems) in your MySQL server. Locate the [mysqld]section in the file, and add or modify the following parameters:Specify the default character set to be UTF-8:
|
|
Set the default storage engine to InnoDB:
[mysqld] ... default-storage-engine=INNODB ... |
Specify the value of max_allowed_packet to be at least 32M:
[mysqld] ... max_allowed_packet=32M ... |
(Refer to MySQL Option Files for detailed instructions on editing my.cnf and my.ini.)
/etc/init.d/mysqld stop' or '/etc/init.d/mysql stop' or 'service mysqld stop'.stop' with 'start'.sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart'.In this step you will create a database within MySQL to hold your Confluence data, and a database user with authority to access that database.
To create the database and user privileges:
mysql' command as a MySQL super user. The default user is 'root' with a blank password.Create an empty Confluence database schema by running this command:
CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin; |
Create the Confluence database user by running this command. Replace 'confluenceuser' and 'confluencepass' with a username and password of your choice. If Confluence is not running on the same server as your MySQL database server, replace 'localhost' with the hostname or IP address of the Confluence server:
GRANT ALL PRIVILEGES ON confluence.* TO 'confluenceuser'@'localhost' IDENTIFIED BY 'confluencepass'; |
Install Confluence if you have not done so already. See the Confluence Installation Guide. Stop immediately after the installation, before opening the Confluence Setup Wizard in your browser, and follow the steps below.
If you have already got part-way through the Confluence Setup Wizard, stop at the database setup step and follow the steps below. You will be able to restart the setup wizard at the same step later.
If you are upgrading Confluence to a later version, and you are already using the recommended MySQL driver (JDBC Connector/J 5.1), you can skip the instructions in this section. The Confluence upgrade task will automatically copy over your existing driver to the upgraded installation.
If you are installing Confluence, or you are upgrading Confluence and not using the recommended MySQL driver (JDBC Connector/J 5.1), follow the steps below.
Choose whether you will set up a direct JDBC connection or a datasource connection to MySQL, to suit your environment. If unsure, choose direct JDBC.
To set up a direct JDBC connection:
If you plan to set up a direct JDBC connection to MySQL, you will need to copy the MySQL JDBC driver to your Confluence installation.
.tar.gz or the .zip archive. Extract the driver JAR file (for example, mysql-connector-java-x.x.x-bin.jar, where x.x.x is a version number) from the archive.<Confluence installation>/confluence/WEB-INF/lib folder.<Confluence installation>/confluence/WEB-INF/lib folder in your new or upgraded Confluence installation.To set up a datasource connection:
If you plan to set up a datasource connection to MySQL, follow the steps described in Configuring a MySQL Datasource in Apache Tomcat.
If you are using a existing database, use the status command to verify database character encoding information. The results should be UTF-8. See Configuring Database Character Encoding.
Start Confluence, and go to the Confluence Setup Wizard in your browser. Follow these steps to set up the new configuration:
confluenceuser) and password you chose earlier. java:comp/env/jdbc/confluenceCongratulations! Confluence is now using your MySQL 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).