Hello,
please, I tried everything about this... I cant make my MySQL server connect with SFS... the messages says it just cant connect to the mysql.driver... I download already the JDBC file and put into the jre/lib/ext, but keeps going on the error.
I tried to put in the brackets <Driver></Driver> of the config.xml everyth path I thought, including this one:
<Driver>org.gjt.mm.mysql.Driver</Driver>
And also the pasth of my windows.
Can anyone help me? I did everything the docs said.
Please, help with DB Connection
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
mysql connection
Hi there,
I have the same problem (I guess) connecting SFS to mysql. I added the mysql jdbc (mysql-connector-java-5.0.8-bin.jar) connector under my ${JAVA_HOME}/lib/ext in redhat.
I still get the same issue. SFS cannot connect with the mysql server. Can you please tell me how you fix it? I use the testSQL query in the config.xml and because of it, SFS cannot restart.
I tested a sample java program I wrote and it connects with the server.
Thanks a lot in advance.
I have the same problem (I guess) connecting SFS to mysql. I added the mysql jdbc (mysql-connector-java-5.0.8-bin.jar) connector under my ${JAVA_HOME}/lib/ext in redhat.
I still get the same issue. SFS cannot connect with the mysql server. Can you please tell me how you fix it? I use the testSQL query in the config.xml and because of it, SFS cannot restart.
I tested a sample java program I wrote and it connects with the server.
Thanks a lot in advance.
Hey man,
Ok, I did this checks to make sure it was working:
- Check the jar file of mysql (double click and execute).
- The test script of SFS to test mysql must have the right IP address and the table must be a valid one of your server (also, the server must be running, of course). If the SQL commands are wrong, it will return a message.
- Check the username and password of your mysql, must be equal into sfs config xml file.
My code:
Ok, I did this checks to make sure it was working:
- Check the jar file of mysql (double click and execute).
- The test script of SFS to test mysql must have the right IP address and the table must be a valid one of your server (also, the server must be running, of course). If the SQL commands are wrong, it will return a message.
- Check the username and password of your mysql, must be equal into sfs config xml file.
My code:
Code: Select all
<DatabaseManager active="true">
<Driver>org.gjt.mm.mysql.Driver</Driver>
<ConnectionString>jdbc:mysql://172.29.38.218:3306/gg</ConnectionString>
<UserName>root</UserName>
<Password>myMySQLpassword</Password>
<TestSQL><![CDATA[SELECT COUNT(*) FROM usuarios]]></TestSQL>
<MaxActive>1</MaxActive>
<MaxIdle>1</MaxIdle>
<OnExhaustedPool>fail</OnExhaustedPool>
<BlockTime>5000</BlockTime>
</DatabaseManager>
Thanks so much for the quick reply!
Well, my code is very similar to yours. The problem might be with the ip of the mysql server. I use localhost now:
<ConnectionString>jdbc:mysql://localhost:3306/smartfox_test</ConnectionString>
Smartfox and my database are now installed on the same machine, so it should work. I wonder if it needs the external ip of the mysql server.
Thanks again!
Well, my code is very similar to yours. The problem might be with the ip of the mysql server. I use localhost now:
<ConnectionString>jdbc:mysql://localhost:3306/smartfox_test</ConnectionString>
Smartfox and my database are now installed on the same machine, so it should work. I wonder if it needs the external ip of the mysql server.
Thanks again!
Maybe you right...
My first problem was due to the mysql jar file... I put in the wrong place. Then I had another problem and it was my local IP.
That IP above is from my MySQL from my work... and this one is from my home:
<ConnectionString>jdbc:mysql://127.0.0.1:3306/gg</ConnectionString>
Try the IP above.
where "gg" is my database.
Also check the SQL code, it must be a valid one to work.
My first problem was due to the mysql jar file... I put in the wrong place. Then I had another problem and it was my local IP.
That IP above is from my MySQL from my work... and this one is from my home:
<ConnectionString>jdbc:mysql://127.0.0.1:3306/gg</ConnectionString>
Try the IP above.
where "gg" is my database.
Also check the SQL code, it must be a valid one to work.
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 43 guests