Dynadot โ€” .com Transfer

Remote MySQL Connections

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch
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
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Truehost โ€” .com domains from $4.99, hosting includedTruehost โ€” .com domains from $4.99, hosting included
Escrow.com
Spaceship
CryptoExchange.com
Domain Recover
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back