[SOLVED] Database - Communications link failure

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

MadHatDragon
Posts: 9
Joined: 09 Mar 2012, 09:47

[SOLVED] Database - Communications link failure

Postby MadHatDragon » 09 Mar 2012, 09:56

I am unsure how to make smartfoxserverx2 connect to the database. Below are versions and settings I am using in the sfs2x remote administration panel.

I assume it knows the jar driver is there because it spits out an exception. Wampserver is running and I can use the phpMyAdmin panel to access the database. In the my.ini file for mysql file it says port 3306.

My guess is I have the driver class name wrong or connection string wrong?

Sfs2x Version: 2.0.1
Wamp Server Version: 2.2
Using Connector: mysql-connector-java-5.1.18-bin.jar
Placed in: SmartFoxServer2X\SFS2X\lib\
Mysql Database Name: sfs2x

Zone Configurator > Database manager
Activate: Yes
Database driver class: org.gjt.mm.mysql.Driver
Connection string: jdbc:mysql://127.0.0.1:3306/sfs2x
Username:
Password:

Error:
com.mysql.jdbc.exception.jdbc4.CommunicationsException
Message: Communications link failure
Last edited by MadHatDragon on 12 Mar 2012, 07:07, edited 1 time in total.
Jake-GR
Posts: 59
Joined: 28 Dec 2011, 22:52

Re: Database - Communications link failure

Postby Jake-GR » 09 Mar 2012, 17:29

I found some different documentation when I was setting mine up, here is my configuration...

Sfs2x Version: 2.0.1
Using Connector: mysql-connector-java-5.1.18-bin.jar
Placed in: SmartFoxServer2X\SFS2X\extensions\__lib__\ (docs I used said to put in this folder)
Mysql Database Name: sfs_game

Zone Configurator > Database manager
Activate: Yes
Database driver class: org.gjt.mm.mysql.Driver
Connection string: jdbc:mysql://127.0.0.1:10061/sfs_game (10061 is the port mysql is running with USB Webserver)
User/Pass: root/usbw (default login for USB Webserver)

So I would verify what port MySQL is running on, and possibly move the connector to the extensions\__lib__ folder. Might be worth a shot.
MadHatDragon
Posts: 9
Joined: 09 Mar 2012, 09:47

Re: Database - Communications link failure

Postby MadHatDragon » 10 Mar 2012, 05:28

I moved the file mysql-connector-java-5.1.18-bin.jar into the directory you recommended. Still no Luck.

Tried to change mysql port, and still no luck.
Jake-GR
Posts: 59
Joined: 28 Dec 2011, 22:52

Re: Database - Communications link failure

Postby Jake-GR » 10 Mar 2012, 08:11

This may be a stupid question, but you are using the correct username and password that is setup to have access to that database?
(just curious as you didn't have anything written in your original post)
MadHatDragon
Posts: 9
Joined: 09 Mar 2012, 09:47

Re: Database - Communications link failure

Postby MadHatDragon » 12 Mar 2012, 02:55

That is not a stupid question! I am still learning, so appreciate any trouble shooting suggestions.

I bet that might be it, but since then a friend was kind enough to let me use their virtual private server and enable a mysql database. I used information they gave me and I was able to connect to that easily.

Thank you again Jake for your help. I am excited it works because I can progress again with learning how to use SFS2X.
Jake-GR
Posts: 59
Joined: 28 Dec 2011, 22:52

Re: Database - Communications link failure

Postby Jake-GR » 12 Mar 2012, 04:42

For really simple testing, this is the program I use locally. http://www.usbwebserver.net/en/
It hosts Apache on port 8080, so that would need to be changed so it doesnt conflict with Smartfox.
MySQL is on a different port as well, but both are easily seen/changed.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 122 guests