问答详情
源自:2-4 Mybatis自动生成器使用方式

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

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

提问者:java黑白白 2018-12-21 16:48

个回答

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

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