Unknown database 'DB_NAME'

Cannot create PoolableConnectionFactory (Unknown database 'DB_NAME'):
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'DB_NAME'

Because, there was no Database scheme in the mysql database engine. So, to solve this:

  1. In console window type "mysql-u root-p" if your mysql username is root and you have a password.
  2. Create new database using "create database DB_NAME".
  3. Exit the mysql console as you don't need it, using "exit" command.

Now, you can restart your grails application and this exception will not show up again.

Wish you best of luck.

原文地址:https://www.cnblogs.com/timssd/p/4750586.html