Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
secured database connection?
Old 08-27-2008, 05:19 AM secured database connection?
subodh's Avatar
Skilled Talker

Posts: 77
Name: Subodh Gaikwad
Location: India
Trades: 1
I am using
PHP Code:
mysql_connect("localhost""user""passwod"); 
function to connect database.
I want to use database on another server and it should be secured connection (SSL).

How can I achieve it? I am newbie in PHP-MYSQL.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
subodh is offline
Reply With Quote
View Public Profile Visit subodh's homepage!
 
 
Register now for full access!
Old 08-27-2008, 05:43 AM Re: secured database connection?
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
http://us3.php.net/function.mysql-connect

Take a look at the fifth parameter for mysql_connect. Pass MYSQL_CLIENT_SSL to use ssl. I believe that the fourth parameter should be set to false and you will also have to specify the IP of the server the database is located on.

PHP Code:
mysql_connect("IP:PORT""user""pass"falseMYSQL_CLIENT_SSL); 
I think that will do it, so long as your sql database is set up for ssl
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 08-27-2008, 05:57 AM Re: secured database connection?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
As null pointer said, but don't forget neither that you have to specify from where you want to connect into mysql too.
Default is "localhost" only, but you can give an ip, or a reverse dns name
Code:
grant all on dbName.* to username@client_machine_ip with password 'mySuperSecretPassword';
Otherwise, you will have a secured channel, but the server will refuse the connection of your user.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to secured database connection?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11590 seconds with 12 queries