Android Question Remote mysql connect timeout.

Endomi

Member
Licensed User
Longtime User
Hello
I am trying to interact with a remote-mysql database.
I call the following procedure, when clicking a button:

B4X:
Sub CreateTable
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = "create_table"
'cmd.Parameters = Array As Object("cat 1")
reqManager.ExecuteCommand(cmd,0)
End Sub

But after +-30 seconds I get the following error,when the code enters JobDone:

DBRequest org.apache.http.conn.ConnectTimeoutException: Connect to /192.168.0.100:17178 timed out

I have tried connecting to my online db using C# and it works, and when I run http://127.0.0.1:17178/?method=test then it says connection successful, but don't know what causing the above connect timeout.
If it's important, I connect my phone to the internet via wifi.
Thanks for assistance.
 

Endomi

Member
Licensed User
Longtime User
BTW my website is hosted with godaddy, is there any setting that I should look at on godaddy's side that might need looking?
Thx
 
Upvote 0

Endomi

Member
Licensed User
Longtime User
When you say server, do you mean my pc or do I have to install rdc on the website hosting account?
Bcos I have installed it on my pc.
 
Upvote 0

Dogbonesix

Active Member
Licensed User
Longtime User
I had trouble getting started with Remote to MySql and you are doing things slightly different. First I use Navicat to create and view tables - it is free (at least view MySql Databases/Tables) fast and easy. Also, using Navicat one knows the connection properties are correct. The part I automate is only the Queries: Select, Update, Insert and Delete. The only way I know - that works repeatably, consistently and without error is using the PHP script in the sample. The sample has (had) some errors due to some hidden characters and such. I have several WebHost - The one I use in the United States could read my PHP script and tell me if the PHP script would/was working - and if it wasn't, why it was not working - which helps a lot. I suspect GoDaddy would do the same. Using HTTP to initiate the queries is pretty straight forward process once a connection is established. HTTPUtils2 is better but the process is more obscure with two additional modules - but once understood it is cleaner. I have not tried the Remote Data Access(RDA) as I am building on success and when the fires die down a bit - I will pursue RDA
 
Upvote 0

Endomi

Member
Licensed User
Longtime User
Is there anything faulty with the below that could be causing my connection-timeout issue? Thx

upload_2013-10-10_20-28-53.png
 
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
Hello,

I'm getting the refused msg too.

The server is up and the test in the server http://127.0.0.1:3036/?method=test shows:
RemoteServer is running (Mon Apr 27 12:42:53 EDT 2015)
Connection successful.

I'm using the port 3036, the firewall has opened this port.

I did the same test in a desktop browser and the device browser and it shows the refused message.

this is my config.properties:

DriverClass=com.mysql.jdbc.Driver
JdbcUrl=jdbc:mysql://localhost/world?characterEncoding=utf8

User=sa
Password=xxx
ServerPort=3036
Debug=true

#commands
sql.create_table=CREATE TABLE animals (\
id INT NOT NULL AUTO_INCREMENT,\
name CHAR(30) NOT NULL,\
image BLOB,\
PRIMARY KEY (id))
sql.insert_animal=INSERT INTO animals VALUES (null, ?,?)
sql.select_animal=SELECT name, image FROM animals WHERE name = ?

This is my c3p0.properties:

c3p0.maxStatements=150
c3p0.maxIdleTime=1800
c3p0.idleConnectionTestPeriod=600
c3p0.checkoutTimeout=60000
c3p0.testConnectionOnCheckout=true

this is a ping from the desktop:

ping 127.0.0.1

Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

I'm using a Windows 2012 server with MySQL

What else should I setup in the server ? Why is a desktop in the same network rejected/refused by the server ? I think that something in the server is blocking internal / external connection
 
Upvote 0

Adilson Jacinto

Active Member
Licensed User
Longtime User
I am having the same issue, Error: org.apache.http.conn.ConnectTimeoutException: Connect to /192.168.0.100:17178 timed out and I am running it on an emulator??


If I navigate on device webroswer: http://192.168.100:17178/?method=test it just takes forever and then the connection to the server timedout, what am I doing wrong @Erel ?
 
Last edited:
Upvote 0
Top