0

I am trying to migrate mysql database into heroku cleardb. I'm doing node service.
My tried code is,
knexfile.js

production: {
client: "mysql",
connection: {
  host:     "us-cdbr-iron-east-04.cleardb.net",
  user:     "bcf521a*******",
  password: "9282****",
  database: "heroku_9c9d767dbb*****"
}    
}  

in heroku, set the config with CLEARDB_DATABASE_URL.it done. When I try to run

heroku run node_modules/.bin/knex migrate:latest
Running node_modules/.bin/knex migrate:latest on ⬢ hidden-taiga-65640
... up, run.7007 (Free)
Using environment: production  

The terminal error shows,

knex: Required configuration option 'client' is missing  

How to resolve this?

Prabha
  • 29
  • 7

1 Answers1

0

Take a good, hard look at your env variables. Make sure that these match your variables in the Heroku app settings. Also, on your knexfile, make sure you're not using || to declare your environment:

const environment = process.env.ENV || 'development';

just leave the process.env.ENV.