Jump to content

Recommended Posts

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'MyExternalIP' (10060) in C:\wamp\www\smith\MySQLTEST.php on line 2

 

I have a site, hosted on my bluehost account which I would like to have reference the database on my local server.  Please note the database is not on the remote site, the one hosted by bluehost, that the end-user connects too.  I am logging in with a user account that accepts any host (host is set to %).

 

It wasn't working so I made a streamlined file that contains only the necessary code for testing, and this also does not work.

 

<?php
$con = mysql_connect('MyExternalIP','UserName','Password');
mysql_error($con);
?>

 

My routers ports are opened correctly, as proven by canyouseeme.org.

 

I'm currently under the default WAMP configuration except I changed Apache to port 880 - I doubt that makes a difference here.

 

Is there a setting I have to have turned on locally in order to allow external connections?  Is there a setting I have to have my webhost turn on in order to allow retrieval from external databases?

Link to comment
https://forums.phpfreaks.com/topic/154979-solved-error-10060/
Share on other sites

Which sticky, the one about php not being able to find the function?  Or did I look at the wrong sticky?

 

At any rate, I'm convinced that it must be a configuration error as I'm using WAMP, and have very little idea of how to configure MySQL.  I originally had this problem on another computer running WAMP at the office, decided to see if I get the same problem on my home machine - I do.  So far as I can tell they are running under the same - seemingly faulty - configuration.  One difference is that the office computer was returning a MySQL error 111.

 

Since I think it may be a configuration error, if it helps, here are all the uncommented lines of my my.ini file

[client]
port		= 3306
socket		= /tmp/mysql.sock

[wampmysqld]
port		= 3306
socket		= /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
basedir=c:/wamp/bin/mysql/mysql5.1.33
log-error=c:/wamp/logs/mysql.log
datadir=c:/wamp/bin/mysql/mysql5.1.33/data

skip-federated

log-bin=mysql-bin

binlog_format=mixed

server-id	= 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

[mysqld]
port=3306

 

I'm using MySQL version 5.1.

Link to comment
https://forums.phpfreaks.com/topic/154979-solved-error-10060/#findComment-816132
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.