Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

MySQL Connection Problem

I have some PHP scripts that run fine on my server. I am able to update, delete, enter records, etc.

WHen I move the pages over to a different server, I get a message like this when I enter the URL of a page with a connector string:

Warning: mysql_connect(): Unknown MySQL Server Host 'db340.perfora.net' (11004) in D:\Inetpub\wwwroot\url.com\html\update.php on line 2
Unable to connect to the database

Any idea why this would happen?
0
lvollmer
Asked:
lvollmer
  • 6
  • 4
2 Solutions
 
kamermansCommented:
db340.perfora.net is not a Fully Qualified Domain Name so you can only access that address internally - you will need to use it's IP Address unless you have access to the authoritative DNS server for perfora.net.
0
 
kamermansCommented:
C:\>nslookup db340.perfora.net
*** Can't find server name for address 192.168.10.1: Non-existent domain
*** Default servers are not available
Server:  UnKnown
Address:  192.168.10.1

*** UnKnown can't find db340.perfora.net: Non-existent domain
0
 
lvollmerAuthor Commented:
so I will replace db340,perfora.net with 192.168.10.1?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
kamermansCommented:
Oh - no - that is a private IP Address and will not work.  You need type 'nslookup db340.perfora.net' in a command prompt on your computer and use the ip address that it comes up with.  If the ip tht you get starts with 10, 192 or 172 it will not work - let me know how your network / server is setup in this case.
0
 
lvollmerAuthor Commented:
the MySQL package is in my hosting package through 1and1.com ... is there some type of MySQL command I can run to tell you this?
0
 
kamermansCommented:
Did you move the MySQL DB to the new web hoster too?  Or are you trying to accss your old server's DB?
0
 
lvollmerAuthor Commented:
no, I use PhpAdmin which is located in the control panel of my package.
0
 
kamermansCommented:
What is the address to phpMyAdmin? if you're lucky you can use the domain from that address.  Some web hosters install MySQL on your webserver in which case you could use 'localhost' as the server.  Ultimately 1and1 would know what you should use for the server address.  Lookup php mysql in their help files.
0
 
lvollmerAuthor Commented:
Your MySQL databases are stored behind a firewall to protect your data. You can only access each one exclusively through your server. Direct access to your MySQL databases using a home PC (external ODBC connection) cannot be established.


I guess that means I am out of luck, right?
0
 
dr_dedoCommented:
this means that you are only allowed to connect to db locally from the very same server. either you move your site back to the original server, or copy your db data to the new server!
0
 
kamermansCommented:
I agree with dr dedo's reply.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now