问题描述
我正在使用播放框架,我想连接数据库,但由于出现以下错误而无法连接:
I am using play framework and I want to connect db, but I can't because I am getting following error:
play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [default]]
Caused by: play.api.Configuration$$anon$1: Configuration error[Failed to initialize pool: Unknown system variable 'tx_isolation']
Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Unknown system variable 'tx_isolation' java.sql.SQLException: Unknown system variable 'tx_isolation
我试图找到tx_isolation
,但是它不存在:
I tried to find tx_isolation
, but it doesn't exist:
mysql> show variables like 'tx_isolation';
Empty set (0.00 sec)
那是什么,怎么找到tx_isolation
?
对不起.这是我的错误代码.我使用的是mysql 8.0.11.所以我找到了'transaction_isolation'
Sorry. this is my error code. and I use mysql 8.0.11. so i find 'transaction_isolation'
play.db {
config = "db"
default = "default"
}
db {
//TODO : 작업필요
default.driver = com.mysql.jdbc.Driver
default.url = "jdbc:mysql://127.0.0.1:3306/testPlayDB"
default.username = root
default.password = "321A@654"
}
错误原因Default.url ="jdbc:mysql://127.0.0.1:3306/testPlayDB"
Error cause Default.url = "jdbc:mysql://127.0.0.1:3306/testPlayDB"
我第一次使用Scala,playframework和StackOverflow ...
i use Scala, playframework and StackOverflow first time...
谢谢.
推荐答案
如果使用的是MYSQL8,请尝试show variables like 'transaction_isolation'
.Mysql8已将tx_isolation
重命名为transaction_isolation
.
If you are using MYSQL8, try to show variables like 'transaction_isolation'
.Mysql8 has renamed tx_isolation
to transaction_isolation
.
这篇关于java.sql.SQLException:未知的系统变量'tx_isolation'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!