SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help accessing database

    Hello

    I have an account at a hosting server. I have a domain, i.e. www.domain1.com, where i have set up a database etc etc.

    Now I have another domain, www.domain2.com, that is on the same server.
    I want to access the Database of Domain1 and Domain2, please guide me how to do that. Both are my domains and on same server.

    Please guide !

    Thanks
    Zeeshan

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Databases are not tied to domains. Whatever issue you're getting at, the "domain1/domain2" thing isn't the problem.

    All you need to connect to a database, from any computer/domain, is an IP or hostname that resolves to the server running the database, a username, a password, and permissions to access from the host you're connecting from.

    If you could be more specific about what you need help with, I'm sure we can help.

  3. #3
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot sir, at the moment, both the domains access the database, via "localhost" so I will contact my hosting company and will ask them how to connect via IP or Server name.

    Thanks

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If they're both on the same server then they should both be able to connect to the same database at localhost.

  5. #5
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hummm, i cant say, because when I logged in with PHPMyAdmin I cant see the database of Domain 1 in the PHPMyAdmin of Domain 2.

  6. #6
    if ($zee == "Guru") { $zee--;}
    Join Date
    Nov 2005
    Location
    Karachi - Pakistan
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so the hint given by Sir Dan Grossman was absolutely correct !

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zeeshanhashmi View Post
    hummm, i cant say, because when I logged in with PHPMyAdmin I cant see the database of Domain 1 in the PHPMyAdmin of Domain 2.
    That would be because the MySQL user account you've set up phpMyAdmin to connect with doesn't have permission to see both databases.


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
  •