Home Database Mysql Tutorial JIRA使用教程:连接数据库—MySQL_MySQL

JIRA使用教程:连接数据库—MySQL_MySQL

May 30, 2016 pm 05:11 PM
Tutorial database

本文主要介绍如何连接JIRA到mysql数据库。

 

首先 查看MySQL的版本是否支持,查阅 支持的平台 。 如果是转移JIRA到另一台服务器,先导出数据为XML备份,然后将旧数据库中的数据传输到新的数据库。 如果你打算用同一个MySQL服务器安装Confluence和JIRA,请阅读 Confluence MySQL安装指南 ,配置你的MySQL服务器来适应Confluence以及JIRA。注意Confluence要求比JIRA要严格,因此应该配置MySQL来适应Confluence,这种配置同样也适用于JIRA。 在开始前关闭JIRA,除非你正在运行Setup Wizard。 1.创建并配置MySQL数据库 创建与JIRA连接的数据库用户(登录角色)例如: jiradbuser 。 

 

mysql> CREATE USER ''@'' IDENTIFIED BY ''; 创建一个数据库(如 jiradb )来存储JIRA的问题,数据库必须有一个UTF8的字符集。在MySQL命令客户端输入以下命令: 

CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin; 确保该用户拥有连接数据库以及创建和写入表的权限。授权命令如下: 

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on .* TO

''@'' IDENTIFIED BY '';

flush privileges;

Tip:

 

为了确认权限是否被授予成功,用JIRA DB用户登录到DB服务器并运行一下命令:

 

SHOW GRANTS FOR @; 2.将MySQL JDBC驱动程序复制到应用服务器

如果是 升级JIRA并且使用的是推荐的MySQL驱动器 (Connector/J JDBC driver v5.1),可跳过此步。JIRA更新会自动复制已存在的驱动到升级后的安装。

 

将MySQL JDBC驱动程序复制到你的应用服务器

 

获得MySQL驱动程序: 如果是 安装JIRA ,下载推荐的MySQL驱动器Connector/J JDBC driver v5.1。 

 

可通过选择'Platform Independent'选项下载.tar.gz或.zip文件。从存档中为驱动提取jar(例如:mysql-connector-java-5.x.x-bin.jar)。 如果是 升级JIRA并且没有使用推荐的MySQL驱动 (JDBC Connector/J 5.1),在更新前先从JIRA备份驱动程序。驱动程序将存储在/lib/ 目录。 复制MySQL JDBC驱动程序到/lib/ 目录来更新JIRA。如果使用windows installer安装JIRA,你需要在运行Windows installer后,但要在运行Setup Wizard之前做这一步。 重启JIRA/JIRA服务器。 如果正在安装JIRA,跳过该页面的其他指示,通过浏览器连接JIRA来运行Setup Wizard。 注意: 上面推荐的MySQL Connector/J驱动,有用户报告遇到Resin JDBC driver for MySQL的问题。 3.配置JIRA服务器来连接MySQL数据库

 

三种配置JIRA服务器连接MySQL数据库的方法:

 

使用JIRA安装向导 (不适用于JIRA WAR)-如果你已经安装JIRA并且是第一次设置,你的设置将被保存到JIRA主目录的dbconfig.xml文件里。 使用JIRA配置工具 (不适用于JIRA WAR)-如果有已存在的JIRA实例,你的设置将被保存到JIRA主目录的dbconfig.xml文件里。 手动配置 -只有当你有JIRA WAR实例或控制台时使用这种方法链接到JIRA服务器。你需要手动更新JIRA主目录里的dbconfig.xml文件。

每种配置方法的说明:

 

JIRA setup wizard 当首次在浏览器连接JIRA时,JIRA设置向导就会出现。 在最开始页面的'Configure Language and Database'设置 Database Connection 为 My own database 。 设置 Database Type 为 MySQL 。 按照下面描述的数据库连接字段填写字段。 测试连接并保存。 JIRA configuration tool 根据下面运行JIRA配置工具: Windows: 打开命令提示符,运行JIRA安装目录的bin子目录文件config.bat。 linux/Unix: 打开控制台,运行JIRA安装目录的bin子目录文件config.sh。 

 

JIRA使用教程:连接数据库—MySQL

 

可能会出现失败的错误,参照此 文章 的解决方法。 导航到 Database 选项卡设置 Database type 为 MySQL 。 按照下面描述的数据库连接字段填写字段。 测试连接并保存。 重启JIRA。 Manually 找到JIRA主目录根目录下的dbconfig.xml文件。 如果该文件不存在,创建该文件,将XML示例代码(如下)复制粘贴到该文件。 根据下面数据库连接字段描述更新该文件。通过在每一个末端添加'amp;'转义所有'&'字符。 注意:元素必须指定数据库类型,如:mysql。如果你忘记指定数据库类型就启动JIRA,那么数据库表将不会被正确创建。若遇到类似问题,参见指定不正确的数据库类型进行解决。 保存文件并重启JIRA。

数据库连接字段:

 

setup wizard/configuration tool dbconfig.xml Description Hostname 位于标记(例如下面的粗体文字): 

jdbc:mysql:// dbserver :3306/jiradb?useUnicode=true&characterEncoding=UTF8&sessionVariables=storage_engine=InnoDB 安装MySQL服务器的机器名称或IP地址。 Port 位于标记(例如下面的粗体文字): 

jdbc:mysql://dbserver: 3306 /jiradb?useUnicode=true&characterEncoding=UTF8&sessionVariables=storage_engine=InnoDB MySQL服务器正在监听的TCP/IP端口。也可以留空来使用默认端口。 Database 位于标记(例如下面的粗体文字): 

jdbc:mysql://dbserver:3306/ jiradb ?useUnicode=true&characterEncoding=UTF8&sessionVariables=storage_engine=InnoDB MySQL数据库(JIRA数据将保存的数据库)的名称。应该在上面第一步时创建。 Username 位于标记(例如下面的粗体字): 

jiradbuser JIRA用于连接MySQL服务器的用户。应在上面第一步时创建。 Password 位于标记(例如下面的粗体字): 

jiradbuser 用于与MySQL服务器身份验证的用户密码。

dbconfig.xml文件示例

 

 

JIRA使用教程:连接数据库—MySQL_MySQL

 

4.启动JIRA

 

现在JIRA连接到MySQL数据库就配置好了。下一步就是启动JIRA。

 

如果正在使用JIRA的'recommended'分配,启动它,并观察日志中是否存在错误。 如果使用的是JIRA WAR分配,重建并重新部署在应用服务器的Web应用程序。 安装注意事项 已知的问题和解决方案: 权限中的主机名称相当于字符串 -如果在MySQL中授权给主机名为localhost,那么从JIRA连接数据库时必须使用相同的字符串。因此使用127.0.0.1就不能工作,尽管它们指向同一个地址。这将产生一个找不到表的错误,这是因为当启动JIRA时JDBC连接没有创建表的权限。 连接关闭 -如果使用下面任何一个来使用MySQL数据库,可能会遇到连接关闭的问题(详见JRA-15731)。阅读 Surviving Connection Closures 来解决问题。 JIRA 3.13 or above, version 5.5.25 or higher of Tomcat 5, version 6.0.13 or higher of Tomcat 6, 数据库密码特殊字符 -JIRA不能释义数据库密码中的特殊字符,请参考 设置数据库密码 。 使用InnoDB存储引擎 - 先前MySQL Server版本到5.5使用的是默认存储引擎MyISAM。因此JIRA数据库在默认配置的MySQL Server5.5以前的版本运行时,可能导致JIRA中的数据损坏。强烈建议在数据库指定sessionVariables=storage_engine=InnoDB参数。这样做确保写入到JIRA的MySQL数据库的表将使用InnoDB存储引擎,它支持JIRA需要的'database transactions'。 二进制日志 -注意JIRA的MySQL使用'READ-COMMITTED'事务隔离级别,目前只支持基于行的二进制日志。若需要MySQL的二进制日志功能,则必须配置MySQL的二进制日志格式为'row-based'。否则,在JIRA中创建问题时可能会出错。详见当 使用MySQL的二进制日志时不能创建问题 。 4字节字符 -注意JIRA不支持MySQL使用4字节字符。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

In summer, you must try shooting a rainbow In summer, you must try shooting a rainbow Jul 21, 2024 pm 05:16 PM

After rain in summer, you can often see a beautiful and magical special weather scene - rainbow. This is also a rare scene that can be encountered in photography, and it is very photogenic. There are several conditions for a rainbow to appear: first, there are enough water droplets in the air, and second, the sun shines at a low angle. Therefore, it is easiest to see a rainbow in the afternoon after the rain has cleared up. However, the formation of a rainbow is greatly affected by weather, light and other conditions, so it generally only lasts for a short period of time, and the best viewing and shooting time is even shorter. So when you encounter a rainbow, how can you properly record it and photograph it with quality? 1. Look for rainbows. In addition to the conditions mentioned above, rainbows usually appear in the direction of sunlight, that is, if the sun shines from west to east, rainbows are more likely to appear in the east.

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

How does Hibernate implement polymorphic mapping? How does Hibernate implement polymorphic mapping? Apr 17, 2024 pm 12:09 PM

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

How to retrieve the wrong chain of virtual currency? Tutorial on retrieving the wrong chain of virtual currency transfer How to retrieve the wrong chain of virtual currency? Tutorial on retrieving the wrong chain of virtual currency transfer Jul 16, 2024 pm 09:02 PM

The expansion of the virtual market is inseparable from the circulation of virtual currency, and naturally it is also inseparable from the issue of virtual currency transfers. A common transfer error is the address copy error, and another error is the chain selection error. The transfer of virtual currency to the wrong chain is still a thorny problem, but due to the inexperience of transfer operations, novices often transfer the wrong chain. So how to recover the wrong chain of virtual currency? The wrong link can be retrieved through a third-party platform, but it may not be successful. Next, the editor will tell you in detail to help you better take care of your virtual assets. How to retrieve the wrong chain of virtual currency? The process of retrieving virtual currency transferred to the wrong chain may be complicated and challenging, but by confirming the transfer details, contacting the exchange or wallet provider, importing the private key to a compatible wallet, and using the cross-chain bridge tool

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How does Go WebSocket integrate with databases? How does Go WebSocket integrate with databases? Jun 05, 2024 pm 03:18 PM

How to integrate GoWebSocket with a database: Set up a database connection: Use the database/sql package to connect to the database. Store WebSocket messages to the database: Use the INSERT statement to insert the message into the database. Retrieve WebSocket messages from the database: Use the SELECT statement to retrieve messages from the database.

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

How to use database callback functions in Golang? How to use database callback functions in Golang? Jun 03, 2024 pm 02:20 PM

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

See all articles