i know this has been asked but none of the threads had a solution that worked for me
I am connecting to RDS from XAMPP (local) with success
Also i am connecting fine with mySql workbench
Having problems connecting from EC2
getting error: Fatal error: Call to undefined function mysql_connect()
this is what my PHP looks like:
define("HOST", "mydatabase-starter.Pzw9yv81CmMJ.us-east-1.rds.amazonaws.com:3306");
define("DBUSER", "mydatabaseUser");
define("PASS", "**********");
define("DB", "mydatabase");
die("Going to connect now, wish me luck!");
$conn = mysql_connect(HOST, DBUSER, PASS) or die();
$db = mysql_select_db(DB) or die();
also, the security from RDS looks like this!
EC2 is a lamp stack, fresh install of apache and php, without mysql.
what am i doing wrong? are there any other services i am missing?
UPDATE: from SSH, i can connect to RDS by:
sudo mysql -h mydatabase-starter.Pzw9yv81CmMJ.us-east-1.rds.amazonaws.com -P 3306 -u mydatabaseUser -p
* this will output "Going to connect now, wish me luck!" from the PHP file
but looks like the connection doesnt happen when it is on EC2