Making SQL allow external sources connect.

ryansstuff

Verified User
Joined
Oct 12, 2010
Messages
8
Right at college i need this website i am building there connect to my server running direct admin with centOS database.
I tried to do it but got this error

Warning: mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /home/72423/public_html/itproject/admin/insertcountry.php on line 6 Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 111

This is to do with my server not allowing connectiong apparently any way i can solve this?
 
if you need to connect from remote to a database hosted into directadmin server you need to go to the mysql management page (the one where you create databases via directadmin), select the database and add % or the IP address you wanna enable on incoming connection.

% means all IP, so 0.0.0.0
if you wanna allow just the web server so put the webserver IP

Regards
 
Right i have doen that what now as it is still getting this error.

If there a setting on mysql or even on the other server that could stop this?
 
Could be a firewall issue.

Google to find the port which needs to be open (both in and out) for remote MySQL. Then make sure your DirectAdmin server allows the port through it's firewall.

If that's open (most firewalls do not leave it open by default, as it's considered a security risk.

Then check with your college network administrator. Very likely it's the college network blocks it for the same reason: it's considered a security risk.

Jeff
 
connection MySQL from external host

Hello,

I try to connect to my database from a software not running on the server "localhost"

I follow the instruction adding in the access hosts :
%
82.xxx.xxx.xxx (my IP address)
localhost (default setting)

I always have the connection error :
"can't connect to mySQL server on '122.xxx.xxx.xxx' (10060)"

I use the following parameters for connection :
$hostname_mywebsite = "122.xxx.xxx.xxx";
$database_mywebsite = "database_name";
$username_mywebsite = "user_name";
$password_mywebsite = "secret";
$mywebsite = mysql_pconnect($hostname_mywebsite, $username_mywebsite, $password_mywebsite) or trigger_error(mysql_error(),E_USER_ERROR);

I try with the following values of $hostname_mywebsite :
= "www.mywebsite.com"
= "122.xxx.xxx.xxx:3306"

My firewall doesnt close the port 3306

Any idea to proceed ?
Thanks
 
Thanks for your reply
But I do not have access to this file.
My database is hosted by www.hostinglotus.com
 
Back
Top