SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    External mysql database

    Hi guys, i have a chat server on a hosting account and the client on a different hosting provider, in my config file to connect to the database it has:

    hostname =jdbc:mysql://localhost/avatarmike

    How can i get this to connect to the other hosting provider?, do i just change localhost to the other hosting domain name?

    thanks.
    Animated Chatrooms - www.121chatrooms.net

  2. #2
    SitePoint Addict
    Join Date
    Nov 2005
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup! I think, all you need to do is to change the your connection string in you config file.

  3. #3
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dosnt work i changed to mysite.com/avatarmike
    Animated Chatrooms - www.121chatrooms.net

  4. #4
    SitePoint Wizard frank1's Avatar
    Join Date
    Oct 2005
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mike4x4s View Post
    Hi guys, i have a chat server on a hosting account and the client on a different hosting provider, in my config file to connect to the database it has:

    hostname =jdbc:mysql://localhost/avatarmike

    How can i get this to connect to the other hosting provider?, do i just change localhost to the other hosting domain name?

    thanks.
    well in that case you would rather need the ip address of the mysql server (with port address if it used any other port than standard)

  5. #5
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    still dosnt work, i pinged my domain and inserted this code:

    hostname =jdbc:mysql://99.198.11.162:3306/islandof_chat
    Animated Chatrooms - www.121chatrooms.net

  6. #6
    SitePoint Wizard frank1's Avatar
    Join Date
    Oct 2005
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mike4x4s View Post
    still dosnt work, i pinged my domain and inserted this code:

    hostname =jdbc:mysql://99.198.11.162:3306/islandof_chat
    well
    in my cases
    hostname ='ip add';
    works for me
    plus i hope that mysql server is allowing remote connections
    i guess islandof_chat is not required in any case

  7. #7
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Typically you have to add remote addresses to mysql as allowed to connect, check with your host as to whether this is needed and how to do it.

  8. #8
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think i may have found something on my cpanel

    You can allow external web servers to access your MySQL databases by adding their domain name to the list of hosts that are able to access databases on your web site.

    Add Access Host
    Host (% wildcard is allowed):


    Do i add the ip address of the server trying to connect?
    Animated Chatrooms - www.121chatrooms.net


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •