Ip of mysql server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xxweekxx
    Confirmed User
    • Oct 2002
    • 6780

    #1

    Ip of mysql server?

    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 am the best
  • directfiesta
    Too lazy to set a custom title
    • Oct 2002
    • 30177

    #2
    Originally posted by xxweekxx
    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 ....

    Comment

    • ztik
      Confirmed User
      • Aug 2001
      • 5196

      #3
      well if you use localhost then it would be the ip of your server
      .

      Comment

      • ServerGenius
        Confirmed User
        • Feb 2002
        • 9377

        #4
        Originally posted by ztik
        well if you use localhost then it would be the ip of your server
        wrong localhost is 127.0.0.1 NOT the internet routed ips on your server
        | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

        Comment

        • xxweekxx
          Confirmed User
          • Oct 2002
          • 6780

          #5
          eh.. well in cpanel i have option to add outside ip
          _________________
          I am the best

          Comment

          • xxweekxx
            Confirmed User
            • Oct 2002
            • 6780

            #6
            this is specifically for phatservers
            _________________
            I am the best

            Comment

            • ServerGenius
              Confirmed User
              • Feb 2002
              • 9377

              #7
              Originally posted by xxweekxx
              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.
              | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

              Comment

              • ztik
                Confirmed User
                • Aug 2001
                • 5196

                #8
                Originally posted by ServerGenius
                wrong localhost is 127.0.0.1 NOT the internet routed ips on your server
                Thats not what I meant

                I mean if he uses localhost its more than likely the internet IP of his server
                .

                Comment

                • ServerGenius
                  Confirmed User
                  • Feb 2002
                  • 9377

                  #9
                  Originally posted by ztik
                  Thats not what I meant

                  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.
                  | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                  Comment

                  • darksoul
                    Confirmed User
                    • Apr 2002
                    • 4997

                    #10
                    Originally posted by ServerGenius
                    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.
                    1337 5y54|)m1n: 157717888
                    BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                    Cambooth

                    Comment

                    • ServerGenius
                      Confirmed User
                      • Feb 2002
                      • 9377

                      #11
                      Originally posted by darksoul
                      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.
                      right....but the question was about a remote server accessing the mysql dbs
                      on another server....no?

                      | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                      Comment

                      • ServerGenius
                        Confirmed User
                        • Feb 2002
                        • 9377

                        #12
                        and if bind-address = 127.0.0.1 is in the my.cnf then using the ip on
                        a server to connect even from that same server still wouldn't work
                        | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                        Comment

                        • darksoul
                          Confirmed User
                          • Apr 2002
                          • 4997

                          #13
                          Originally posted by ServerGenius
                          and if bind-address = 127.0.0.1 is in the my.cnf then using the ip on
                          a server to connect even from that same server still wouldn't work
                          I don't think he said otherwise
                          he only pointed that the ip for mysql its the same with his server ip
                          nothing about if it works or not.
                          1337 5y54|)m1n: 157717888
                          BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                          Cambooth

                          Comment

                          • ServerGenius
                            Confirmed User
                            • Feb 2002
                            • 9377

                            #14
                            Originally posted by darksoul
                            I don't think he said otherwise
                            he only pointed that the ip for mysql its the same with his server ip
                            nothing about if it works or not.
                            my bad then....I understood it in relation to the initial question.....
                            | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                            Comment

                            • xxweekxx
                              Confirmed User
                              • Oct 2002
                              • 6780

                              #15
                              Well i guess my next question is this, being that i most likeyly cant post remotely.

                              If you have a form on www.sitea.com

                              but your mysql database is in www.siteb.com, how can you post from sitea.com to siteb.com

                              You could put in html, post to www.siteb.com/postscript.php

                              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 nobosdy know where im posting it.
                              _________________
                              I am the best

                              Comment

                              • darksoul
                                Confirmed User
                                • Apr 2002
                                • 4997

                                #16
                                have a postscript on siteb that uses curl to post transparently to sitea
                                1337 5y54|)m1n: 157717888
                                BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                                Cambooth

                                Comment

                                • ServerGenius
                                  Confirmed User
                                  • Feb 2002
                                  • 9377

                                  #17
                                  Originally posted by xxweekxx
                                  Well i guess my next question is this, being that i most likeyly cant post remotely.

                                  If you have a form on www.sitea.com

                                  but your mysql database is in www.siteb.com, how can you post from sitea.com to siteb.com

                                  You could put in html, post to www.siteb.com/postscript.php

                                  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.
                                  | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                                  Comment

                                  • xxweekxx
                                    Confirmed User
                                    • Oct 2002
                                    • 6780

                                    #18
                                    how do u use curl to post transparently?

                                    target address isnt shown inside script but anyone can view source of html page and see where its posting to.. thats my problem
                                    _________________
                                    I am the best

                                    Comment

                                    • ServerGenius
                                      Confirmed User
                                      • Feb 2002
                                      • 9377

                                      #19
                                      Originally posted by xxweekxx
                                      how do u use curl to post transparently?

                                      target address isnt shown inside script but anyone can view source of html page and see where its posting to.. thats my problem
                                      storing the post info on siteB and retrieve that file with curl from siteA through a cronjob

                                      the script variant post script to self and have a function where upon post
                                      the result is send to mysqldb on siteA

                                      | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                                      Comment

                                      • ServerGenius
                                        Confirmed User
                                        • Feb 2002
                                        • 9377

                                        #20
                                        you can use curl also to post directly to the mysql db from siteB to siteA
                                        there's a number of options you have with it. siteB:~#man curl
                                        | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                                        Comment

                                        • xxweekxx
                                          Confirmed User
                                          • Oct 2002
                                          • 6780

                                          #21
                                          "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?
                                          _________________
                                          I am the best

                                          Comment

                                          • xxweekxx
                                            Confirmed User
                                            • Oct 2002
                                            • 6780

                                            #22
                                            deos phatservers allow remote posting to mysql dbase
                                            _________________
                                            I am the best

                                            Comment

                                            • ServerGenius
                                              Confirmed User
                                              • Feb 2002
                                              • 9377

                                              #23
                                              Originally posted by xxweekxx
                                              "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.
                                              | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                                              Comment

                                              • xxweekxx
                                                Confirmed User
                                                • Oct 2002
                                                • 6780

                                                #24
                                                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.
                                                "
                                                _________________
                                                I am the best

                                                Comment

                                                Working...