Remote MySQL Connections

SpaceshipSpaceship
Watch

user-7256

VIP Member
Impact
111
Hi,

I have set an access host in Cpanel so that a remote server can access my MySQL database.

1) What port do I need?

2) What should my PHP connection script look like?

Thanks,
-Matt
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
The default port is 3306 according to Google. The script is the same as always, just put the server's name instead of localhost in mysql_connect.
 
0
•••
Hm, okay, thanks!
 
0
•••
Also bear in mind that the user must have permission to connect from the remote host (name / IP) or any host (*), often users are restricted to localhost
 
0
•••
when connecting to a remote mysql host if no port is specified then the default port is assumed so as long as the remote host has not changed the port then you have no need to add it to your script.

And as stated the only difference in your script will be the host, instead of using localhost you will use the ip or host name for the new host.
 
0
•••
Ah okay... thanks!
 
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
NameMaxi - Your Domain Has Buyers
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back