0

I do all my web development projects using Cloud9 (which is actually part of AWS now). Anyways I have had no problem connecting using the built in PHP functions and variables but the Node platform has been giving me some trouble. The Cloud9 community guide for connecting to MySQL was much more clear for PHP than Node, and other questions and answers I have found online have had a large array of suggests but none have worked. Here is what I would have considered my best bet:

var connection = mysql.createConnection({
    host: process.env.IP,
    user: process.env.C9_USER,
    password: "",
    port: 3306,
    database: "database_name"
});

1 Answers1

1

Start aws cloud9 mysql service with the code:

sudo service mysqld start

Then "host" and "password" has to be used as seen below.

var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : '*******',
  database : 'database_name'
});

That is the link for how to install and start mysql service in aws cloud9 in case of anyone needs.

aws cloud9 mysql service installation

Cihangir
  • 1,892
  • 1
  • 11
  • 16