iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-25-2008, 10:38 PM
WebProWorld Pro
 
Join Date: Aug 2006
Location: Cary, Illinois
Posts: 265
getmea RepRank 1
Unhappy MySQL connect error to an outside database

Hi all...long time no post.

Here's a mysql issue my site is experiencing. Mind you, my site was recently upgraded to a new VDECK and new PHP Admin. Hmm...

I have a bi-weekly script I run which points to my supplier's database, opens 2 tables, and extracts inventory information. I have a standard script to set up the server, user, pw, etc.:

$server = 'xxx'; // server location
$user = 'xxxxxxxxxx'; // db username
$password = 'xxxxxx'; // db password
$db = 'xxxxxxxxx'; // db name
$link = mysql_connect("$server", "$user", "$password") or die(mysql_error());
$db_selected = mysql_select_db($db,$link);

But the last time I successfully ran the script was early June. I have been getting the following error for 2 weeks now:

Can't connect to MySQL server on 'mysql-3.db.vi.net' (111).

whenever I run CHEAP SKATEBOARD SHOP: DECKS, TRUCKS, WHEELS | www.Getmea-Skateboard.com. I've tried writing other scripts, no dice.

I checked with my supplier (and sent them my code) and their dba said he has no problem accessing the db from their end...nothing has changed...etc.

What do you think has happened here? Has PHP or mySQL locked out access to dbs outside of my domain?

Thanks in advance...
Reply With Quote
  #2 (permalink)  
Old 06-26-2008, 11:09 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: MySQL connect error to an outside database

If you can access your server's command line, I would suggest using one of the built in MySQL tools which should give you more feedback on the problem. First, try the mysqlshow client app to get a list of databases on the remote server which you can access.

shell> mysqlshow -h hostname -u username -p password

You should get either a list of databases you can access, or a connection error message. This information should give you more details for when you contact support.

If the tables you need to access are listed, try running queries directly, using the MySQL client.

shell > mysql -h hostname -u username -p password database_name

You should be able to test various queries directly once you are connected. The error messages you encounter can help your support correct the issues.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #3 (permalink)  
Old 06-27-2008, 11:15 PM
WebProWorld Pro
 
Join Date: Aug 2006
Location: Cary, Illinois
Posts: 265
getmea RepRank 1
Default Re: MySQL connect error to an outside database

Hi, Wige...thanks for the reply...

Unfortunately, my webhost is tighter than a...well, it's tight. I am unable to perform command-line activities.

Still trying to get an answer from my webhost...
Reply With Quote
  #4 (permalink)  
Old 06-27-2008, 11:23 PM
WebProWorld Pro
 
Join Date: Aug 2006
Location: Cary, Illinois
Posts: 265
getmea RepRank 1
Default Re: MySQL connect error to an outside database

I spoke too soon...I did not want to mention the web host's name, but here is iPower.com's response:

We apologize for any inconvenience this may have caused you. We have checked the issue and noticed that you are using database which is not present on our server. Unfortunately, this is not possible to use a database present in external server. You have to create that database on our server in order to resolve the issue.

If you have any further questions, please update the Support Console


I've been running this externally-pointed db script for 8 months!

This is the last straw. First, they blocked data file imports into mySQL (.xls); this made data updating extremely time consuming on my own db...next they blocked PHP scripts pointing to an external domain...now this!

I am so frustrated over these guys...
Reply With Quote
  #5 (permalink)  
Old 06-28-2008, 07:30 AM
WebProWorld Veteran
 
Join Date: Jul 2004
Posts: 913
activeco RepRank 2
Default Re: MySQL connect error to an outside database

It could be privileges issue where your new host is not allowed to access db.
If you didn't do it already try issuing command from mysql client, logged as admin:
GRANT SELECT ON mydb.* TO 'someuser'@'%' IDENTIFIED BY 'some_pass';

If you don't use linux, there are windows mysql clients too.

If they really don't allow access to external database, you can move the db files to your server or change the host.
__________________
Impossible? You just underestimate the time.
Reply With Quote
  #6 (permalink)  
Old 07-30-2008, 06:35 AM
WebProWorld New Member
 
Join Date: Jul 2008
Posts: 1
yuriB RepRank 0
Default Re: MySQL connect error to an outside database

had connection problems with mysql, solved them with this
MySQL can't connect Error - FixYa

Hope it will help you,
Yuri.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mySQL Too Many Connections Open error getmea Database Discussion Forum 17 12-19-2007 08:56 AM
Can't connect to new SQL database spenland Database Discussion Forum 3 03-27-2006 06:52 AM
Can't connect to new SQL database cyanide Database Discussion Forum 0 03-06-2006 11:09 PM
Server Error 500 on PHP/MySQL site MarcieZoob Web Programming Discussion Forum 6 07-17-2005 07:02 AM
Script Time Out Error with MySql Database printas Database Discussion Forum 1 05-04-2004 01:31 AM


All times are GMT -4. The time now is 08:23 AM.



Search Engine Optimization by vBSEO 3.3.0