在线多数据源
最后更新于:2022-04-02 07:12:38
**怎样配置在线多数据源**
首先打开配置管理页面:系统监控>多数据源管理
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/8a/1b/8a1b6ec13f7397c32843025c33090a43_1908x857.png)
1.新增
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/88/8c/888c7d410422d761c43d60f038f607ce_726x670.png)
>[danger]数据源编码是唯一的,并且编码必须以字母开头,可包含数字、下划线、横杠。
填写完信息后可以点测试看是否配置正确,如下图,弹出测试成功即配置正确
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/db/33/db33fb01155668de64358e6413edce44_923x770.png)
2.编辑
如信息填写有错误,可以点编辑修改,注意数据源编码是不可能更改的
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/88/f6/88f6c1b86001207240231cf2715a5dc1_867x752.png)
同理,Oracle和SQLServer数据库配置方法一样,只要选择对应的数据库类型,填写上连接的账号密码即可
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/3a/f5/3af5ddc5d130047eb5d895006a74ae3d_782x463.png)
注意:
若回显的驱动类和数据源地址与你的数据库版本不一致,可自行修改。**例如:**
### Mysql5.x与Mysql8.0.X的几点不同
***Mysql5.x***
驱动类:com.mysql.jdbc.Driver
数据源地址:jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=utf-8&useSSL=false
***Mysql8.0.X:***
驱动类:com.mysql.cj.jdbc.Driver
数据源地址:jdbc:mysql://127.0.0.1:3306/jeecg-boot?useUnicode=true&characterEncoding=UTF8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
3.测试
在线开发>online报表配置
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/6b/31/6b31f68381600c1f91e953be54e6725b_1911x525.png)
编辑:配置数据源
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/be/a1/bea14e6d9ae9a164626ca2b1706ea991_1911x352.png)
点击 ‘功能测试’
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/cc/8e/cc8e720096296c65476569dc56da314a_1734x493.png)
出现下图一直加载或者查询失败,则数据源配置有误
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/fe/82/fe823f04b57da26f1741f42e8439d073_1725x551.png)
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/ef/02/ef02db431c5f414e4164033918fa603a_1727x506.png)
出现如下图,则数据源配置正确
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/1a/47/1a479a7daab026cb48d999d69940b883_1725x309.png)
';