我正在尝试使用以下代码在Amazon RDS上连接MySQL Server:

 var pool = new ConnectionPool(
      host: "xxxx.rds.amazonaws.com",
      port: 3306,
      user: "root",
      password: "123456",
      db: "crm",
      max: 5);
  try {
    var results = await pool.query("show tables;");
    results.forEach((row) {
      print(row);
    });
  } catch (exception) {
    print(exception);
  }

我遇到了这个:
2017-07-13 19:14:11.556440: ConnectionPool: Running query: show tables;
2017-07-13 19:14:11.562390: ConnectionPool: Getting a connection
2017-07-13 19:14:11.562800: ConnectionPool: Number of in-use connections: 0
2017-07-13 19:14:11.563133: ConnectionPool: Creating new pooled cnx#0
2017-07-13 19:14:11.565475: Connection.Lifecycle: Use connection #0
2017-07-13 19:14:11.566736: Connection: opening connection to xxxx.rds.amazonaws.com:3306/portea_crm
2017-07-13 19:14:11.653693: BufferedSocket: WRITE data
2017-07-13 19:14:11.689824: BufferedSocket: READ data
2017-07-13 19:14:11.689943: BufferedSocket: READ data: no buffer
2017-07-13 19:14:11.690250: Connection: readPacket readyForHeader=true
2017-07-13 19:14:11.690613: BufferedSocket: readBuffer, length=4
2017-07-13 19:14:11.690815: BufferedSocket: readBuffer, data already ready
2017-07-13 19:14:11.693935: BufferedSocket: read 4 bytes
2017-07-13 19:14:11.694517: Connection: about to read 78 bytes for packet 0
2017-07-13 19:14:11.694662: Connection: buffer size=78
2017-07-13 19:14:11.694714: BufferedSocket: readBuffer, length=78
2017-07-13 19:14:11.694755: BufferedSocket: readBuffer, data already ready
2017-07-13 19:14:11.694969: BufferedSocket: read 78 bytes
2017-07-13 19:14:11.702610: Connection: completing with exception: 'package:sqljocky/src/auth/auth_handler.dart': malformed type: line 24 pos 24: cannot resolve class 'SHA1' from '_AuthHandler@16306938'
      var hasher = new SHA1();
                       ^

与在库中调用SHA1的crypto lib依赖关系有关系吗?

另外,我的SQLjocky版本是0.6.1。我在发布站点上看到的是0.14.1。为什么我不能更新?

最佳答案

最后,

我在Sqljocky中使用RPC。

他们有不同版本的加密软件包。

解决,

dependencies:
  rpc: "^0.5.7+1"
  sqljocky: "^0.14.1"
  crypto: '>=0.9.0 <0.10.0'

dependency_overrides:
  crypto: '>=0.9.0 <0.10.0'

10-06 08:02