PDA

View Full Version : mysql problems


cwturley
01-31-2007, 01:19 PM
hello i use MySql admin to manage my sql data bases. ( on my other web servers) and i was just wondering if anyone has tried to use it with blue host. i am having problems trying to connect to my servers database here (blackwolfraiders.com)

redsox9
01-31-2007, 02:36 PM
I've been using the MySQL databases here at BlueHost for the past year with no problem. It sounds like you might have an issue with permissions if you are trying to call to these databases from other servers. I'd start there...

dkinzer
01-31-2007, 08:24 PM
I am having problems trying to connect to my servers database here (blackwolfraiders.com)
As I understand it, BH doesn't allow offsite connections to mySQL databases on their servers except from previously arranged IP addresses. Contact support to get set up.

svetur
01-31-2007, 09:07 PM
bluehost doesn't allow remote connections to their database - they support only ssh remote access. I got burned on that one....:mad:

areidmtm
01-31-2007, 09:19 PM
Bluehost DOES allow remote access to databases without SSH. You have to add the IP in the while list AND in the Access Hosts sections of the MySQL DB set up. Or just contact support and they should be able to add your IP for you. You may have to add your entire IP c-class.

Or just set up SSH access.

svetur
01-31-2007, 09:55 PM
I just spend an hour with tech support - he didn't know about "Access Hosts sections of the MySQL DB set up". Should i contact tech support again and ask someone else to talk to????

areidmtm
01-31-2007, 09:58 PM
I can connect to my DBs remotely using navicat or mysqlcc. I can either use my domain name or my IP.

Make sure that you have add the use to the proper database :)

svetur
01-31-2007, 10:09 PM
i created file simple test file access.php

<?php
$dbh=mysql_connect ("MY_STATIC_IP", "xx_root", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("xxx_xxx");
?>

Launched it and got an error - cannot connect to database on MY_STATIC_IP
( my static ip is bluehost ip )
I move it to bluehost public_html > launched it - same thing. changed to localhost - no problem

Pethens
01-31-2007, 10:18 PM
I'm able to connect this way without a problem using either the mysql command line tool or a PHP script. My PHP look like this:

$db = mysql_connect('mydomain.com', 'my_username', 'password');

I don't think that's significantly different from what you're doing but I can't tell for sure from your pseudocode.

Keep in mind that besides whitelisting your IP, you also have to go into cPanel > MySQL Databases, go to the "Access Hosts" section, and add the hostname of the computer you connect to at your ISP.

Stephen

areidmtm
01-31-2007, 10:19 PM
you also have to go into cPanel > MySQL Databases, go to the "Access Hosts" section, and add the hostname of the computer you connect to at your ISP.

Didn't I just say that? ;)

Pethens
01-31-2007, 10:27 PM
Didn't I just say that? ;)

It looks like you did ;) Next time I'll read the thread more carefully before I post.

svetur
01-31-2007, 10:40 PM
I'm with tech support now - still nothing.
I have my ip added to white list, i have access host - my ip and % to accept any ip.

Still:
Warning: mysql_connect(): Can't connect to MySQL server on 'MY_STATIC_IP' (110) in /var/www/html/meetme/go.php on line 3
i cannotCan't connect to MySQL server on 'MY_STATIC_IP' (110)

I'm loggin from 2 different servers on 3306 port.

areidmtm
01-31-2007, 10:51 PM
It looks like you did ;) Next time I'll read the thread more carefully before I post.

I was just giving you crap :)

areidmtm
01-31-2007, 10:52 PM
I'm with tech support now - still nothing.
I have my ip added to white list, i have access host - my ip and % to accept any ip.

Still:
Warning: mysql_connect(): Can't connect to MySQL server on 'MY_STATIC_IP' (110) in /var/www/html/meetme/go.php on line 3
i cannotCan't connect to MySQL server on 'MY_STATIC_IP' (110)

I'm loggin from 2 different servers on 3306 port.

You have given the user access to the databases, right?

svetur
01-31-2007, 11:43 PM
Yes - still nothing. Tech support was able to access my databases ok. But i still have no success. Logically thinking it has to be my machine, because he was able to login via my username, password, database. My IP address is added to whitelist, i have % in access host list as well as my ip included. I was told by my provider that firewall is open to 3306 port. I'm puzzled. I get

Warning: mysql_connect(): Can't connect to MySQL server on 'XXXXX' (110) in /var/www/html/meetme/go.php on line 3
i cannotCan't connect to MySQL server on 'XXXX' (110)

pmcinvest
02-01-2007, 09:22 AM
I had a similar problem and your solution may be the same one I found.

The username is NOT the domain name with which I log into BH.
The username is NOT the un with which I log into my db.
The username is NOT the "user" listed in phpMyAdmin.
The username IS the first part of "user" listed in phpMyAdmin before the "@".

This was posted in the discussion: http://www.bluehostforum.com/showthread.php?t=4257

areidmtm
02-01-2007, 10:10 AM
Also, this just came to mind, if you're running any firewalls or anti-virus programs on your computer, make sure they are allowing the port to go threw.

Pethens
02-01-2007, 01:04 PM
The error message you're getting from PHP isn't very informative. If you have the mysql command line tool I would suggest trying to connect with that by typing

mysql -u my_bluehost_username -h mydomain.com -p

then entering your password when prompted. Presumably this will also fail to connect, but you might get an error message with some hint of what's really going on.

svetur
02-01-2007, 08:54 PM
I tried from several computers. I typed the line you suggested, but still i get :
ERROR 2003 (HY000): Can't connect to MySQL server on 'MY_IP_ADDRESS' (110)
It takes about 4 minutes - then i get error.
I can enter wrong password, wrong username - i get the same error. It doesn't make sence.
If it doesn't give me detailed error - username or password problem - does this mean i'm getting stopped at the firewall?????

I have % in access hosts and ip in white list.

----------------------------
i can log in to other server databases with no problem , i can log in to my server from bluehost - just access to bluehost is giving me problems!

svetur
02-02-2007, 06:55 PM
FIXED!!!!!!!!!!!!!!!

Level 3 tech worked on this problem and then tech support guy reset firewall and reset white list and i was able to connect finally to database.
It was firewall problem after all.

Thanks everybody for support.