# Database "kong" does not exist

**URL:** <https://discuss.konghq.com/t/database-kong-does-not-exist/2798>\
**Category:** Questions\
**Created:** [February 11, 2019, 6:02pm UTC](https://discuss.konghq.com/t/database-kong-does-not-exist/2798 "2019-02-11T18:02:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![petro](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@petro](https://discuss.konghq.com/u/petro)\
**Post date:** [February 11, 2019, 6:02pm UTC](https://discuss.konghq.com/t/database-kong-does-not-exist/2798/1 "2019-02-11T18:02:40Z")

</div>

Setting up kong in amazon linux with an RDS postgres database. Created database named “kong” which is up and running. Here are the relevant conf file entries:

database = postgres  
pg\_host = [kong-db.cjtzpy1hzftb.us-east-2.rds.amazonaws.com](http://kong-db.cjtzpy1hzftb.us-east-2.rds.amazonaws.com)  
pg\_port = 5432  
pg\_timeout = 5000  
pg\_user = kong  
pg\_password = \*\*\*\*\*\*\*\*  
pg\_database = kong

When I run kong migrations up, I get the following:

2019/02/11 17:49:09 [verbose] prefix in use: /usr/local/kong  
Error:  
/usr/local/share/lua/5.1/kong/cmd/migrations.lua:91: [PostgreSQL error] failed to retrieve server\_version\_num: FATAL: database “kong” does not exist  
stack traceback:  
[C]: in function ‘assert’  
/usr/local/share/lua/5.1/kong/cmd/migrations.lua:91: in function ‘cmd\_exec’  
/usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function \</usr/local/share/lua/5.1/kong/cmd/init.lua:87\>  
[C]: in function ‘xpcall’  
/usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function \</usr/local/share/lua/5.1/kong/cmd/init.lua:44\>  
/usr/local/bin/kong:7: in function ‘file\_gen’  
init\_worker\_by\_lua:48: in function \<init\_worker\_by\_lua:46\>  
[C]: in function ‘xpcall’  
init\_worker\_by\_lua:55: in function \<init\_worker\_by\_lua:53\>

I think security groups are all fine. Any thoughts?

---

<div class="post-metadata">

**Author:** ![desktophero](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/desktophero/32/107_2.png) [@desktophero](https://discuss.konghq.com/u/desktophero)\
**Post date:** [February 11, 2019, 6:30pm UTC](https://discuss.konghq.com/t/database-kong-does-not-exist/2798/2 "2019-02-11T18:30:46Z")

</div>

Are you able to see how long the `kong start` to the failure is taking? I ask as if the connection appears to be timing out, you might have a security group issue.

Otherwise, I recommend double checking the values, including using `psql` from the EC2 instance.

---

<div class="post-metadata">

**Author:** ![petro](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@petro](https://discuss.konghq.com/u/petro)\
**Post date:** [February 12, 2019, 2:31am UTC](https://discuss.konghq.com/t/database-kong-does-not-exist/2798/3 "2019-02-12T02:31:20Z")

</div>

Thanks for the recommendation of using psql from the EC2 instance. I had the database name and the instance the same. When I changed pg\_database to be ‘postgres’ instead of ‘kong’ in the config file, all worked. Appreciate the assist.

---

<div class="post-metadata">

**Author:** ![yanshinian](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@yanshinian](https://discuss.konghq.com/u/yanshinian)\
**Post date:** [May 6, 2019, 4:13am UTC](https://discuss.konghq.com/t/database-kong-does-not-exist/2798/4 "2019-05-06T04:13:34Z")

</div>

Look this article [https://www.setouchino.cloud/blogs/96](https://www.setouchino.cloud/blogs/96)  
maybe help you
