Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku won't reset my database

I have been trying to run $ heroku pg:reset from the command line but I believe I'm not putting in the database correctly. I've tried a number of variations.

I ran $ heroku config | grep POSTGRESQL to get the database name which prints as

HEROKU_POSTGRESQL_PINK_URL: postgres://naknaswvxfvuup:QK2dHYNMZ_va10lDgMDo4S0BIM@ec2-23-21-161-255.compute-1.amazonaws.com:5432/db7eute4gu4mcb

I've tried running everything from

#1

$ heroku pg:reset HEROKU_POSTGRESQL_PINK_URL: postgres://naknaswvxfvuup:QK2dHYNMZ_va10lDgMDo4S0BIM@ec2-23-21-161-255.compute-1.amazonaws.com:5432/db7eute4gu4mcb

#2

$ heroku pg reset postgres://naknaswvxfvuup:QK2dHYNMZ_va10lDgMDo4S0BIM@ec2-23-21-161-255.compute-1.amazonaws.com:5432/db7eute4gu4mcb

#3

$ heroku pg:reset db7eute4gu4mcb

and other variations. Please let me know how to correctly note this as I keep getting either an error or this text from the commmand line " ! Unknown database: db7eute4gu4mcb. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_PINK_URL"

I'm currently at 10.4 on the Ruby on Rails tutorial. Thanks!

like image 566
Marquett Davon Burton Avatar asked Nov 29 '22 13:11

Marquett Davon Burton


1 Answers

You should specify a DATABASE when run heroku pg:reset. This is the syntax:

heroku pg:reset <DATABASE>

To know the value of , you can run:

heroku pg:info

It will return DATABASE_URL, something like: HEROKU_POSTGRESQL_GRAY_URL
Then you can reset your database:

heroku pg:reset HEROKU_POSTGRESQL_GRAY_URL

In your case, to reset database run:

heroku pg:reset HEROKU_POSTGRESQL_PINK_URL
like image 75
Thanh Avatar answered Dec 04 '22 06:12

Thanh