Please, help with DB Connection

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

kaligus
Posts: 45
Joined: 01 Sep 2009, 13:26

Please, help with DB Connection

Postby kaligus » 02 Sep 2009, 11:22

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.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 02 Sep 2009, 12:19

I think thats a question more for the "regular" parts of the forums. Someone should be able to help you there!

:-)

/Thomas
kaligus
Posts: 45
Joined: 01 Sep 2009, 13:26

Postby kaligus » 02 Sep 2009, 12:30

Ok, sorry Thomas.

Anyway, I solved. I mean... I think I put the mysql driver in a wrong place.

:oops:
fotios
Posts: 4
Joined: 05 Oct 2009, 09:39

mysql connection

Postby fotios » 05 Oct 2009, 09:51

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.
kaligus
Posts: 45
Joined: 01 Sep 2009, 13:26

Postby kaligus » 05 Oct 2009, 10:07

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:

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>
fotios
Posts: 4
Joined: 05 Oct 2009, 09:39

Postby fotios » 05 Oct 2009, 23:16

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!
kaligus
Posts: 45
Joined: 01 Sep 2009, 13:26

Postby kaligus » 06 Oct 2009, 10:14

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.

:wink:

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 23 guests