Im on shared hosting. I want to post to my mysql database on there from another server. How do i find out the mysql ip on my shared hosting(with cpanel)
Im on shared hosting. I want to post to my mysql database on there from another server. How do i find out the mysql ip on my shared hosting(with cpanel)
Thanks
I doubt that the host allows to access the db from outside... Normally, it is " localhost" for that reason.
He can, thru WHM, add a permission for an outside IP. Then you have to do the same in Cpanel.
I know that Asspimple is stoopid ... As he says, it is a FACT !
But I can't figure out how he can breathe or type , at the same time ....
eh.. well in cpanel i have option to add outside ip
then add the ip from the server you want to use to access the mysql db.
and on that server use the ip of your domains on the mysql server as mysql
host. Make sure that the server you access the mysql server from is allowing
TCP connections to port 3306 and allows related connections for replies on high
ports
Last edited by ServerGenius; 07-10-2007, 08:06 AM.
I mean if he uses localhost its more than likely the internet IP of his server
No coz the other ips on a server are internet accessible ips and localhost
isn't.
Localhost means you can access it only from the server itself and not
remotely.
same as mysql config variable skip-networking which prevents the server
to accept ANY other connection to the mysql server EXCEPT for the server
itself.
No coz the other ips on a server are internet accessible ips and localhost
isn't.
Localhost means you can access it only from the server itself and not
remotely.
same as mysql config variable skip-networking which prevents the server
to accept ANY other connection to the mysql server EXCEPT for the server
itself.
you're too quick to jump the gun
what he said is if he's using localhost to connect to mysql
then mysql could be reached through the ip of the server since its
not hosted on a remote server.
what he said is if he's using localhost to connect to mysql
then mysql could be reached through the ip of the server since its
not hosted on a remote server.
right....but the question was about a remote server accessing the mysql dbs
on another server....no?
but then people could go to your html and see posting location.
Anyway to hide this?
basically how can i post to a script/database hosted on a remote location and have nobody know where im posting it.
the target address isn't shown if it's inside the php code instead of the
html code. But frankly if you restrict the mysql server to accept connections
from specific ip addresses only that's kinda irrelevant. as mysql would only
accept connections from the whitelisted ips.
I suggest making those restrictions with iptables (linux) or ipfw (freebsd)
instead of using the mysql config to determine this or both.
"the script variant post script to self and have a function where upon post
the result is send to mysqldb on siteA"
how do i do this?
the formpost script in the form tag post where you put the url where it should
be posted should go it self so the same script generates the form will also be
the script where the info is being posted.
the function that does the actual posting looks for variable POST when that
one is set it takes the info and post it to another script on siteA that will insert
the info into the mysql db. (this doesn't require siteA to be able to connect
directly to mysql)
If it allows to connect to mysql remotely you can post the info directly into
the mysql db using a mysql query that uses siteA's ip as mysql host for that
query.
if you don't need this today email me what form fields you want and I'll email
you back the code in a day or max 2 days.
genius (at) servergenius dot com
Last edited by ServerGenius; 07-10-2007, 10:34 AM.
ah..thanks.. kinda confused about,
"the formpost script in the form tag post where you put the url where it should
be posted should go it self so the same script generates the form will also be
the script where the info is being posted.
"
Comment