如何连接到 JIRA 独立安装的数据库?
我使用独立安装程序(不是来自 war 发行版)安装了 JIRA。据我了解,独立版本会立即安装数据库和所有依赖项。现在我需要访问该数据库,但我不知道默认的数据库用户和密码是什么,也不知道如何连接到它。我可以以 root 身份访问运行 JIRA 的计算机。有什么想法吗?
I installed JIRA using the standalone installer (not from the war distribution). As I understand it the standalone version installs a database and all deps at once. Now I need to get access to that database but I dont know what the default db user and password and I am not sure how to connect to it. I have access to the machine running JIRA as root. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
接受的答案没有给出实际的说明,链接 已移动。
更完整的答案可以节省我的时间,因此我添加了详细的答案,以防对其他人有帮助:
路径/到/JIRA/HOME/数据库
jiradb.script
将位于此目录中,因此您可以尝试仅搜索该文件。在 Mac/Unix 上:查找 . -名称“*jiradb.script”
path/to/JIRA/bin/stop-jira.sh
/lib
文件夹中(即 path/to/JIRA/lib)<块引用>
java -cp lib/hsqldb-1.8.0.5.jar org.hsqldb.util.DatabaseManager -user sa -url jdbc:hsqldb:HOME/database/jiradb
cd
到根目录,对我来说,它类似于/Users/mymachine/Downloads/atlassian-jira-6.4.9-standalone< /代码>
上面命令中看到的
jiradb
只是告诉DatabaseManager类要使用哪个文件前缀。实际的数据库位于jiradb.script
中
仅限命令行
如果您无法访问图形环境(例如在无头 Unix 系统上),则上述步骤 3 将不起作用。该命令会抱怨 DISPLAY 变量未设置,或者无法连接到 X11 实例。
下面是一个备用 HSQLDB 命令,它将在非图形设置中工作:
lib/sqltool.jar
、lib/hsqldb.jar
和sample/sqltool.rc
,所有这些都是您需要的。设置 rc 文件适当的连接字符串(在我的示例中名为jira)。示例 rc 文件中的个人条目是一个很好的起点:只需将文件路径更改为 jira 数据库的位置即可。
运行
sqltool.jar
而不是hsqldb.jar
。您现在可以针对此数据库运行 SQL 命令<预><代码> $ java -jar sqltool.jar jira
The accepted answer doesn't give actual instructions and the link has moved.
A more complete answer would have saved me time, so I'm adding a detailed answer just in case it helps someone else:
path/to/JIRA/HOME/database
jiradb.script
will be located in this directory so you can try just searching for that file. On Mac/Unix:find . -name "*jiradb.script"
path/to/JIRA/bin/stop-jira.sh
/lib
folder (i.e. path/to/JIRA/lib)cd
to that the root directory, first, which for me was something like/Users/mymachine/Downloads/atlassian-jira-6.4.9-standalone
jiradb
seen in the command above simply tells the DatabaseManager class which file prefix to use. The actual database lives injiradb.script
Command-line only
If you don't have access to a graphical environment, such as on a headless Unix system, then step 3 above will not work. The command will complain that the DISPLAY variable is unset, or that it cannot connect to X11 instance.
Here's an alternate HSQLDB command, which will work in a non-graphical setting:
lib/sqltool.jar
,lib/hsqldb.jar
, andsample/sqltool.rc
, all of which you will need.Set up an rc file with an appropriate connection string (named jira in my example). The personal entry from the sample rc file is a good starting point: just change the filepath to the location of the jira database.
Run
sqltool.jar
instead ofhsqldb.jar
. You can now run SQL commands against this databaseJIRA 附带的数据库是 HSQL 数据库。可以使用 HSQL 控制台访问它。您可以在 JIRA 的 wiki 中找到说明。 http://confluence.atlassian.com/display /JIRA/运行+SQL+命令+in+a+HSQL+数据库
The DB that comes with JIRA is an HSQL DB. It can be accessed using an HSQL console. You can find instructions in JIRA's wiki. http://confluence.atlassian.com/display/JIRA/Running+SQL+commands+in+a+HSQL+database
您还可以停止 JIRA 并查看 database/jiradb.script 文件
You can also stop JIRA and look at the database/jiradb.script file