I have a project that I am working on that is written in node js, and I am using mysql for database. I deployed my app on Heroku but Heroku doesn't seem to support mysql databases. Is there a website like mlab.com where I can connect to mysql while having my app hosted on Heroku? Any advice would be appreciated! Thank you!
Asked
Active
Viewed 330 times
2 Answers
1
According to the Heroku MySQL to Postgresql(retrieved 2018), there are a number of MySQL/[MariaDB] addon services.
Related is the previous answer: How to deploy local MySQL database to Heroku

danblack
- 12,130
- 2
- 22
- 41
0
Use the following code to connect your node js to your MySQL Database on a live server
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root', // your root username
database : 'yourdatabase' // the name of your db
});

buddemat
- 4,552
- 14
- 29
- 49

Ayman Shakil
- 1
- 1