2016-09-13 22 views
0

は、私はapplication.confに以下の行を追加してプレイ2.5ドキュメントPlay2.5 MySQLデータベースの接続エラー:データベースに接続できない[DB]

のMySQLデータベースエンジンの接続プロパティ

# Default database configuration using MySQL database engine 
# Connect to playdb as playdbuser 
db.default.driver=com.mysql.jdbc.Driver 
db.default.url="jdbc:mysql://localhost/playdb" 
db.default.username=playdbuser 
db.default.password="a strong password" 

をフォロー

# Default database configuration using MySQL database engine 
# Connect to playdb as playdbuser 
db.default.driver=com.mysql.jdbc.Driver 
db.default.url="jdbc:mysql://localhost/playdb" 
db.default.username=root 
db.default.password="password" 

私はエラーを得た

Configuration error 
Cannot connect to database [db] 

私はテストのためにMac上でローカルmysqlを使用しています。ユーザー名とパスワードが正しい。

playdbデータベースが作成されます。

mysql> show databases; + --------------------- + |データベース| + --------------------- + | information_schema | |ライブラリ_開発 | library_production | | library_test | | mysql | | performance_schema | | playdb | | sys |セットで + --------------------- + 8行(0.00秒)

おかげ

+0

完全なスタックトレースを表示できますか? – Salem

+0

ありがとうピーター: http://stackoverflow.com/questions/38169619/connect-mysql-database-with-play-framework-2-5 OK。このスレッドと重複しています。 私はdbを削除する必要があります。設定から。 – searain

答えて

関連する問題