last week I created a Node server with MySQL. Everything went fine. I was using the configvars to connect and made the whole mobile app with the endpoints.
Suddenly, today, Heroku decided to close the connection to MySQL database (ClearDB) and throw status 503 and Connection lost.
const mysql = require('mysql');
const db = mysql.createPool({
connectionLimit : 120,
host : 'hostFromHeroku.cleardb.net',
user : 'user',
password : 'password',
database : 'databaseName',
debug : false
});
db.getConnection((err,connection)=> {
if(err)
throw err; //THIS LINE THORS THE ERROR
console.log('Database connected successfully');
connection.release();
});
module.exports = db;
This is the HEroku console
I tried to connect dozens of times again and again... Dont know whats wrong.
I checked the clearDB portal and noticed that on the portal the connection dissapeared. Tried also to connect with MySQL workbench but the connection still cannot be established...
In the figure above there are still no connections... Checked the credentials few dozens of times.... Any ideeas? If anyone wants more pieces of code please let me know
Thanks, Daniel