求助,这里run,访问/页面后就报错,可能跟druid有关,求助~

来源:2-4 Mybatis自动生成器使用方式

java黑白白

2018-12-21 16:48

2018-12-21 16:46:38.732  INFO 26450 --- [reate-876802782] com.alibaba.druid.pool.DruidDataSource   : put physical connection to pool failed.

2018-12-21 16:46:38.736  INFO 26450 --- [       Thread-3] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'

2018-12-21 16:46:38.737 ERROR 26450 --- [reate-876802782] com.alibaba.druid.pool.DruidDataSource   : create connection holder error


java.sql.SQLException: Could not retrieve transation read-only status server

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1084) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:949) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:939) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3976) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3947) ~[mysql-connector-java-5.1.30.jar:na]

at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:143) ~[druid-1.1.3.jar:1.1.3]

at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:84) ~[druid-1.1.3.jar:1.1.3]

at com.alibaba.druid.pool.DruidDataSource.put(DruidDataSource.java:2024) ~[druid-1.1.3.jar:1.1.3]

at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2282) [druid-1.1.3.jar:1.1.3]

Caused by: java.sql.SQLException: Unknown system variable 'tx_read_only'

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1084) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4232) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4164) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2832) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2781) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1569) ~[mysql-connector-java-5.1.30.jar:na]

at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3970) ~[mysql-connector-java-5.1.30.jar:na]

... 5 common frames omitted



配置文件也照着老师的写的

https://img.mukewang.com/5c1ca9500001d86813740508.jpg

写回答 关注

1回答

  • 龙虾三少
    2018-12-22 12:32:47

    你电脑上装的mysql server的版本要和maven内引入的version大版本号一致,视频里用的是mysql 5.几的client和server,检查下是否不一致

SpringBoot构建电商基础秒杀项目

应用SpringBoot快速搭建拥有用户、商品、交易及秒杀活动的电商秒杀应用。

49065 学习 · 954 问题

查看课程

相似问题