I'm writing my first script that will connect via SSL to a MySQL database. I have been doing a lot of reading on the subject and have come across many options on how to set it up; some that apply to my situation and some that don't. Here is my situation:
The MySQL server is on the same machine as the script. My SSL Certificate is installed. Is it secure to simply connect to the database via a page that is using SSL with the following code?
Connecting via https://www.mysitehere.com/myscript.php
$con = mysql_connect("localhost", "username", "password", MYSQL_CLIENT_SSL);
if (!$con) {die('Could not connect: ' . mysql_error());}
mysql_select_db("my_database", $con);