需求:
. 标准安装,是使用Confluence默认的hsql小型内存数据库,不适用较大项目部署;
目前需要更换为外部数据库安装,本人是使用mysql数据库
如果是新建的话 怎么做呢?
Confluence 需要一个驱动程序以连接到 MySQL 。
您将需要: 下载 MySQL驱动程序 将 .jar 文件放入 /mnt/data/wiki/atlassian/confluence/confluence/WEB-INF/lib
重启 Confluence 并继续安装过程。
mysql-connector-java-8.0.25.jar: https://url69.ctfile.com/f/253469-953200443-fb123e?p=2206 (访问密码: 2206)
需要在 MySQL 上建立一个 confluence 的 数据库
1)创建数据库
CREATE DATABASE confluence DEFAULT CHARACTER SET utf8mb4;
ALTER DATABASE confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; #排序规则
或者:
CREATE DATABASE confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
(2) 授权
grant all on confluence.* to root@'localhost';
您的数据库必须使用'READ-COMMITTED'作为默认隔离级别。了解更多
set global transaction isolation level read committed; flush privileges;
然后刷新,就没有提示了。
怎么更换呢?
/var/atlassian/application-data/confluence/confluence.cfg.xml
我修改了一下:
<?xml version="1.0" encoding="UTF-8"?>
<confluence-configuration>
<setupStep>complete</setupStep>
<setupType>custom</setupType>
<buildNumber>8402</buildNumber>
<properties>
<property name="admin.ui.allow.daily.backup.custom.location">false</property>
<property name="admin.ui.allow.manual.backup.download">false</property>
<property name="admin.ui.allow.site.support.email">false</property>
<property name="atlassian.license.message">AAABMA0ODAoPeJxtkE1PwzAMhu/5FZE4d+qHCtWkSGRpJgr9GHRDcMyKN4yybEqaiv17uo1dEEfbr x899s3cIuV+S+OURsk0zaZpSEW7pHEYJyQH11k89Lg3TOzNRnswHZDa79Zgm83KgXUsiIiwoE6hX PXATptBmAVxSsadXnV9rXbANH55Q7qRMhlbOADrrYdrRFYKNUMzoMO1hnvXgYGJ0UQOSvsznG2Ud nAhlDjOHSyPBzjDRVNV8kUUvCQjyPRg1Cgqvw9ojxepJLkLovgkdQZcTxDaux5svf8Ax0LSypq9N yta8SdJK0k5bXlOF7zO+YQ0dqsMuosM1q/Y4qyUdCl5RVqwA9giZ7MsE4GYvT0H7UNxG8yjx4T82 o7Tssiv1f9yC2+7T+Xgzyd/ACgHiH8wLAIUKjAj+mPNsF0uxInPS+lzRR81l3ACFDlpMeMrjOs7N vhumpOCOeQqkaFoX02f7</property>
<property name="attachments.dir">${confluenceHome}/attachments</property>
<property name="confluence.setup.locale">zh_CN</property>
<property name="confluence.setup.server.id">B88C-CBXQ-SHI6-F1J3</property>
<property name="confluence.webapp.context.path"></property>
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.idle_test_period">100</property>
<property name="hibernate.c3p0.max_size">60</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.min_size">20</property>
<property name="hibernate.c3p0.timeout">30</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.isolation">2</property>
<property name="hibernate.connection.password">kFp66358rjRTyrRx</property>
<property name="hibernate.connection.url">jdbc:mysql://103.13.220.244:3306/confluence?sessionVariables=transaction_isolation='READ-COMMITTED'</property>
<property name="hibernate.connection.username">confluence</property>
<property name="hibernate.database.lower_non_ascii_supported">true</property>
<property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.setup">true</property>
<property name="jwt.private.key">MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQCK+cr5wqIgMof06MkV7VfCDhIXZG+7s2zCDikN1lpw4BU3nZcQjtm9Zt9CL3g+GszJ/I4H+GHY1ZMZ9AlpBpVjjO/dLsuSHIj1meiY1tEfwhp2xyPQ8JOeyWBxoSOVb0WVI9toA8R8O1JLTCcaPtuc75H1bfYGNjwuwkePopPaUrk8YS05cEZl/zjUl6kukTx9vnJ7xV2+vlLt6jEjpFUhHQmqzTPeAKYpk6H+3d4qeIFBPlrwJFmaiQ+J3BmeXmit1/lHEA5mi17MClHl+uhTEteRnEG9Sdm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dZacOAVN52XEI7ZvWbfQi94PhrMyfyOB/hh2NWTGfQJaQaVY4zv3S7LkhyI9ZnomNbRH8Iadscj0PCTnslgcaEjlW9FlSPbaAPEfDtSS0wnGj7bnO+R9W32BjY8LsJHj6KT2lK5PGEtOXBGZf841JepLpE8fb5ye8Vdvr5S7eoxI6RVIR0Jqs0z3gCmKZOh/t3eKniBQT5a8CRZmokPidwZnl5ordf5RxAOZotezApR5froUxLXkZxBvUnZnMCYzfyAGr1u+k+cTdlyWAyVkA3m1GZjXw+UVhGAIVXPWnsiMIEIJItnoObHZwZvjs2+uoCUcHspRkU0F5vFO+J41oY+hhvQlR3KCsa9Zc3qhZIpQbp+JApls6/mkB9qoNQpUGCghRCfvpldRSndEO8QIwNARvx1BRJ5Y+QGto5K0dDYIhOOiT5bUGhbBZRQo/WYT3gX9R3eNnIqMS9dQmaxUQmPzxCRAgMBAAE=</property>
<property name="lucene.index.dir">${localHome}/index</property>
<property name="setup.hasSelectedBundle">true</property>
<property name="synchrony.encryption.disabled">true</property>
<property name="synchrony.proxy.enabled">true</property>
<property name="webwork.multipart.saveDir">${localHome}/temp</property>
</properties>
</confluence-configuration>
其实最主要的是修改了 这几个内容, 找到对应的 字段,就可以。
我的 mysql 是正常可以访问的, 本机测试过的。
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.isolation">2</property>
<property name="hibernate.connection.password">kFp66358rjRTyrRx</property>
<property name="hibernate.connection.url">jdbc:mysql://103.13.220.244:3306/confluence?sessionVariables=transaction_isolation='READ-COMMITTED'</property>
<property name="hibernate.connection.username">confluence</property>
<property name="hibernate.database.lower_non_ascii_supported">true</property>
<property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.MySQLDialect</property>
更改后,我重启 confluence
sh /opt/atlassian/confluence/bin/stop-confluence.sh
出现界面:
Unable to bootstrap application: The database driver (com.mysql.jdbc.Driver) was not found in the class path
解决方法:
把mysql的驱动包放在web工程下的WEB-INF下的lib目录下即可。
Confluence had problems starting up
This page is for Confluence administrators. If you're seeing this page, your Confluence administrator is probably working to restore the service.
Database: The database collation 'utf8mb4_0900_ai_ci' is not supported by Confluence. You need to use 'utf8_bin, utf8mb4_bin'.
网上的办法,没有搞好,
发现应该是自己建库有问题的
ALTER DATABASE confluence CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; #排序规则
如果mysql服务器不能更改字符集(因为没有权限或者还有别的数据库共享同一个mysql实例)可以如下配置confluence数据库连接:Link to 4、如果mysql服务器不能更改字符集(因为没有权限或者还有别的数据库共享同一个mysql实例)可以如下配置confluence数据库连接:
编辑文件: <Confluence-home>/confluence.cfg.xml
/var/atlassian/application-data/confluence
更新此属性:
<property name="hibernate.connection.url">jdbc:mysql://yourhost:3306/confluence?connectionCollation=utf8mb4_bin</property>
然后重启 confluence
成功!!!
然后 更换 url , 这个刚登陆 会在右上角提示你的。
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.isolation">2</property>
<property name="hibernate.connection.password">baimei123</property>
<property name="hibernate.connection.url">jdbc:mysql://39.108:3306/confluence?connectionCollation=utf8mb4_bin</property>
<property name="hibernate.connection.username">baimei</property>
<property name="hibernate.database.lower_non_ascii_supported">true</property>
<property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.setup">true</property>
欢迎来撩 : 汇总all