Unable to connect to mysql

mysql

#1

I seem to be unable to connect with mysql in Cloud9. I followed the steps on https://docs.c9.io/docs/setup-a-database. That all worked; it responds to mysql-ctl cli as expected. However, when I run npm run rollback it gives the error:

Error: getaddrinfo ENOTFOUND $IP $IP:3306
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)

What should I do to resolve this error?

I have set the following environment variables:

DB_NAME=c9
DB_USER=$C9_USER
DB_PASS=
DB_HOST=$IP
DB_DRIVER=mysql
DB_PORT=3306

Knexfile.js should be all right, since someone else has the app running on his local computer. It contains the following code (excluded the production part of the code):

require('dotenv').config({ path: 'variables.env' });
const {DB_NAME, DB_USER, DB_HOST, DB_PASS, DB_DRIVER, DB_PORT} = process.env;

module.exports = {
  development: {
    client: DB_DRIVER,
    connection: {
      host: DB_HOST,
      user: DB_USER,
      password: DB_PASS,
      database: DB_NAME,
      port: DB_PORT,
    },
    migrations: {
        directory: './db/migrations',
        tableName: 'migrations'
    },
    seeds: {
        directory: './db/seeds'
    },
    pool: {
      afterCreate: function(connection, callback) {
        connection.query('SET time_zone = "+2:00";', function(err) {
          callback(err, connection);
        });
      }
    }
  }
};