您的位置:首页 > 数据库 > MySQL

配置JIRA Standalone连接MySQL数据库

2008-10-24 14:26 1161 查看
[align=left]1. Configure MySQL[/align]
[align=left]1. Create a database user which JIRA will connect as (e.g. jirauser). [/align]
[align=left]2. Create a database for JIRA to store issues in (e.g. jiradb). [/align]
[align=left]The database must have a character set of UTF8. Enter the following command from within the MySQL command client: [/align]

[align=left]create database jiradb character set utf8;[/align]
[align=left](if you want your database to be named jiradb). [/align]
[align=left]3. Ensure that the user has permission to connect to the database, and create and populate tables. [/align]

2. Copy the MySQL driver to your application server
1. Download the MySQL Connector/J JDBC driver, eg. version 3.1.12 (tar.gz or zip) which we have verified to work. NOTE: the older 3.1.11 driver is broken.
[align=left]2. Add the MySQL JDBC driver jar (mysql-connector-java-3.x.x-bin.jar) to the common/lib/ directory. NOTE: Do not place the Debug Driver (mysql-connector-java-3.x.x-bin-g.jar) on the CLASSPATH as this can cause issues (JRA-8674). [/align]
[align=left] [/align]
3. Configure your application server to connect to MySQL
1. Edit conf/server.xml (if you are using JIRA Standalone) and customise the username, password, driverClassName and url parameters for the Datasource. (If you are using JIRA WAR/EAR, edit the appropriate file on your application server; e.g. for Tomcat, edit conf/Catalina/localhost/jira.xml.)
<Context path="" docBase="${catalina.home}/atlassian-jira"
reloadable="false">
<Resource name="jdbc/JiraDS" auth="Container"
type="javax.sql.DataSource"
username="[enter db username]"
password="[enter db password]"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/jiradb?autoReconnect=true
     &useUnicode=true&characterEncoding=UTF8"
[ Jiradb:前面为Jira创建的数据库名称 ]
[ delete the minEvictableIdleTimeMillis and 
      timeBetweenEvictionRunsMillis params here ]
/>
<Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"
factory="org.objectweb.jotm.UserTransactionFactory"
jotm.timeout="60"/>
<Manager className="org.apache.catalina.
session.PersistentManager" saveOnRestart="false"/>
</Context>


4. Configure the JIRA Entity Engine
Edit atlassian-jira/WEB-INF/classes/entityengine.xml (if you are using JIRA Standalone) or edit-webapp/WEB-INF/classes/entityengine.xml (JIRA WAR/EAR), and change the field-type-name attribute to mysql. (If you forget to do this and start JIRA, it may create database tables incorrectly. See this page if this happens to you.) Also delete the schema-name="PUBLIC" attribute, if it exists

<datasource name="defaultDS" field-type-name="mysql"
[ delete this, if it exists: schema-name="PUBLIC" ]
helper-class="org.ofbiz.core.entity.GenericHelperDAO"
check-on-start="true"
use-foreign-keys="false"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: