codingapi / codingapi/tx-lcn

开启日志记录初始化表DataSource连接有问题

オープン
#462 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
4.2k
フォーク
1.4k
PR マージ指標
30日以内にマージされた PR はありません

説明

- [ ] I have searched the [issues](https://github.com/codingapi/tx-lcn/issues) of this repository and believe that this is not a duplicate.

### 1. Bug Description
tx-lcn.logger.enabled=true 时DataSource会变成本地IP。username@本地IP 。mysql版本8.0.7
感觉是 HikariDataSource getConnection的问题。但没仔细看我先关掉这个配置了

### 2. Environment:
- JDK version:
- OS:
- TX-LCN version:5.0.2
- Others:
tx-lcn.logger.enabled=true
tx-lcn.logger.driver-class-name=com.mysql.cj.jdbc.Driver
tx-lcn.logger.jdbc-url=jdbc:mysql://192.168.0.10:3308/tx-manager?useSSL=false&characterEncoding=utf8&serverTimezone=UTC&allowPublicKeyRetrieval=true
tx-lcn.logger.username=username
tx-lcn.logger.password=password

### 3. Exception Stacktrace
java.sql.SQLException: CREATE command denied to user 'username'@'192.168.0.226' for table 't_logger' Query: CREATE TABLE IF NOT EXISTS `t_logger` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`group_id` varchar(64) NOT NULL ,
`unit_id` varchar(32) NOT NULL ,
`tag` varchar(50) NOT NULL ,
`content` varchar(1024) NOT NULL ,
`create_time` varchar(30) NOT NULL,
`app_name` varchar(128) NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) Parameters: []
at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:527) ~[commons-dbutils-1.7.jar:1.7]
at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:531) ~[commons-dbutils-1.7.jar:1.7]
at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:497) ~[commons-dbutils-1.7.jar:1.7]
at com.codingapi.txlcn.logger.db.LogDbHelper.update(LogDbHelper.java:55) ~[classes/:na]
at com.codingapi.txlcn.logger.helper.MysqlLoggerHelper.init(MysqlLoggerHelper.java:70) [classes/:na]
at com.codingapi.txlcn.common.runner.TxLcnApplicationRunner.run(TxLcnApplicationRunner.java:54) [classes/:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:809) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:799) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:341) [spring-boot-2.0.5.RELEASE.jar:2.0.5.RELEASE]
at com.codingapi.txlcn.tm.TMApplication.main(TMApplication.java:35) [classes/:na]
```
Paste your Exception Stacktrace here!
```

### 4. Tour Idea

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

MysqlLoggerHelper.java と LogDbHelper.java から始め、tx-lcn.logger.enabled=true と提供された MySQL 設定を使用して再現しながら、TxLcnApplicationRunner.java からの初期化を追跡します。設定された DataSource が想定されたホストに接続し、CREATE 権限エラーなしで t_logger を初期化できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, mysql, spring-boot
領域
backend, databases
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。