Connect MySQL database with node JavaScript application
问题 I make a node JavaScript app and deploy it on cPanel using SSH. App is working fine without database but when I connect the app with database on cPanel (GoDaddy) it takes times and shows the message "Error establishing a database connection". My connection code const mysql = require('mysql'); const express = require('express'); const app = express(); var pool = mysql.createConnection({ host: 'localhost', user: '<MY_USER_NAME>', password: '<MY_PASSWORD>', database: '<DB_NAME>' }); pool.connect