MySQL External Access

Problems with the Windows version of XAMPP, questions, comments, and anything related.

MySQL External Access

Postby dog199200 » 04. November 2010 09:25

Hello,

In the past I have used several WAMP programs, but have always had problems with them, mainly in regards to MySQL. So far XAMPP is working rather well, though I have come across a problem and I'm not exactly sure what to do. I am a video game developer who is working on getting up my own own MMORPG. For this I have my games server and a completely separate server that is located outside of my network to host my games website. I need to be able to pass files back and forth from my games website and the mysql databased used to store my games information, but so far all i keep getting is errors.

Website Error:
Code: Select all
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'server1.shiningashes.net' (4) in /home/divinesh/public_html/serverstatus.php on line 105


Game Server Error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'divineshadowsonline.com' (10060) in C:\xampp\htdocs\index.php on line 18
Can't connect to MySQL server on 'divineshadowsonline.com' (10060)


I've been looking for a while now and I can't find ANYTHING that is close to relevant to explain what to do. My router is currently configured to run DMZ, directing all port forwarding to my server. All the ports that are required for XAMPP are open, I have checked this using multiple port checking websites online. I have also edited the my.ini, making sure that bind-address and skip-networking are commented out. I also made sure every port is open within my firewall as well. I've been here for two days trying to figure this out and cant figure it out so I figured it was time to ask for some help.

I am currently using the xampp-win32-1.7.3 installer. I'm running Windows Server 2008 on my game server and my webserver is running Linux. I have remote mysql setup in both, user accounts with wildcard access to any host (%) yet its still not working. Does anyone have any ideas? Is there something in XAMPP somewhere thats blocking it completely?


Thank you for your time and help,
~Dwight
dog199200
 
Posts: 3
Joined: 04. November 2010 09:07

Re: MySQL External Access

Postby JonB » 04. November 2010 15:47

what was the bind address you used?

:?:

Also read these two, maybe one will have the answer.

http://dev.mysql.com/tech-resources/art ... ndows.html

http://serverfault.com/questions/52794/ ... sing-xampp

I'm going to check something on one of my servers in a bit...

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: MySQL External Access

Postby JonB » 04. November 2010 16:55

Yeppers -

my.ini needs 3 fixes:

1st - change socket type from "MySQL" to "TCP/IP" (MySQL is a local socket)
2nd - comment out "enable-named-pipe"
3rd - add this line : bind-address=0.0.0.0

Be sure the user you plan to connect as has global '%' or host list connection rights in MySQL.

Code: Select all
# The MySQL server
[mysqld]
basedir                 = "C:/xampp/mysql/"
datadir                 = "C:/xampp/mysql/data/"
port                  = 3306
#socket                  = "MySQL"
socket                  = "TCP/IP"
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

default-time-zone       = "America/New_York"

log_error           = "C:/xampp/mysql/data/mysql.err"
pid_file            = "mysql.pid"
general_log         = 0
general_log_file    = "C:/xampp/mysql/data/mysql.log"
slow_query_log      = 0
slow_query_log_file = "C:/xampp/mysql/data/mysql-slow.log"

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
#enable-named-pipe
bind-address=0.0.0.0


Tested on both localhost and remote connections.

let me know if it works correctly for you.
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: MySQL External Access

Postby dog199200 » 04. November 2010 23:37

Thanks for the help, but its still not working. I uninstalled it all and ran a clean install to make 100% my changed wouldnt mess it up and it still doesn't work.
dog199200
 
Posts: 3
Joined: 04. November 2010 09:07

Re: MySQL External Access

Postby JonB » 05. November 2010 03:46

Are you still getting the 10060 error on thosr machines I guess???

you are collecting the data on your local XAMPP MySQL database, right?

connecting from these two servers by way of applications that are going to connect and tehn presumably write to one of your databases, right?

I have a suggestion - I use a tool called MySQL Workbench, its a free GUI desktop MySQL design tool - it has version for about all OS'es. I used it to debug a lot, including how I got rid of the 10060 Winsock errors trying to connect to a default XAMMP install. It has a nice feature - test connection. Why don't you try it from off your local net, and see if you can connect, if it throws the error its a XAMPP/transport issue, if it connects, its a code issue... I guess its really not XAMPP , as its purely opening a connection on your local MySQL database - Apache wouldn't have to be running really. Maybe you need a handler.

just a htought, good luck

:)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: MySQL External Access

Postby dog199200 » 06. November 2010 09:31

Ah its no problem. I figured out what was wrong.. My host had a Firewall blocking remote mysql from incoming and outgoing traffic.. I had them put an exception and now it works.
dog199200
 
Posts: 3
Joined: 04. November 2010 09:07


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 50 guests