Knowledgebase

Connecting to MySQL

Posted by -Edward-, 09-21-2007, 04:11 PM
Hi, I'm running two VPS's, I'm running MySQL on one and HTTPD on the other, they communicate perfectly but I was wondering what the safest way was to connect to MySQL remotely through a PHP Script. Currently my script connects in this format: Is there anyway of making this connection more secure?

Posted by stuffradio, 09-21-2007, 06:45 PM
maybe remove the mysql error from the public server. people can see the error information when there is an error, and possibly exploit your scripts if there is any exploit and can gain access to your mysql database.

Posted by whmcsguru, 09-21-2007, 07:49 PM
Try this instead. Just make sure to call setup_con somewhere in your header. I actually have this whole thing as sql.inc for functional purposes, and it works nice enough for me .

Posted by findhost32, 09-22-2007, 12:51 AM
Secure just because your error will not be dispoayed on the screen just the message

Posted by Jatinder, 09-22-2007, 02:19 AM
Another thing you can do is to use SSL while connecting to your mysql server. Pass MYSQL_CLIENT_SSL as the fifth patameter to mysql_connect to initiate an encrypted connection.

Posted by -Edward-, 09-22-2007, 05:04 AM
I've looked into this, But it degrades on performance and requires more CPU processing time. I'm looking to try and keep processing time to a minimum. Thanks Linuxtech i'll take a look at what your script a bit more later on today. My database connection script is stored below the visible web directory already, i'm just wondering if theres a more secure way without adding SSL into the mysql config and slowing it down.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
mysql monitor (Views: 565)


Language:

Client Login

Email

Password

Remember Me

Search