Android Question Jdrc2 mysql connector error

ocalle

Active Member
Licensed User
Longtime User
Hi, I used and tested the excellent example of Erel to connect a remote database "in my case" mysql,

https://www.b4x.com/android/forum/t...ation-of-rdc-remote-database-connector.61801/

In the local computer work fine, but when i try to connect a vps host "Where reside the database table" receive connection refused, what can i do with these, Need some access from the provider?, i put the user, password and table correcty, ip and default pòst "3306" too.

In the config.properties i have


B4X:
#Lines starting with '#' are comments.
#Backslash character at the end of line means that the command continues in the next line.
#DATABASE CONFIGURATION
DriverClass=com.mysql.jdbc.Driver
#------------------------------------------------------------------------------------------
                                       /------------Added the port too
JdbcUrl=jdbc:mysql://50.31.138.79:3306/rdc?characterEncoding=utf8
User=root
Password=xxxxx
#Java server port
ServerPort=17178
Thanks in advance.
 

OliverA

Expert
Licensed User
Longtime User
Could be a lot of things. Did you install the MySQL server on the VPS? If not, provider may use another port. The provider may need you to set up access rules to allow that traffic to your VPS. With all that out of the way, you have to allow the user to connect from a remote machine (default is local log in only)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

ocalle

Active Member
Licensed User
Longtime User
Hi,

  1. Im using a VPS server with Windows Server R12
  2. installed the B4J and compiled the JRCD2 on it, got a fixed IP. In the other hand i create a Mysql table in another of my hosting provider.
  3. put the address of W Server to allow Mysql connection to. (Wilcard is enabled too) in the another hosting provider (Mysql database location)
  4. Installed wamp server too
  5. Tested on VPS the local ip to see if it works 127.0.0.1:17178/test (work fine)
  6. Tested on VPS the local ip to see if it works 127.0.0.1:17178/rcd (access denied)
  7. On one of my programming computer launched the b4a client example (thats reach succesfully the jrdc server)
I saw some docs in Stackoverflow and see the string connector may be the trouble
In the example the msyql connector is :

JdbcUrl=jdbc:mysql://50.xx.13x.79:3306/rdc?characterEncoding=utf8

But in Stack say this string connector need be

jdbc:mysql://localhost:3306/dbname

Need i do?
JdbcUrl=jdbc:mysql://50.xx.13x.79:3306/mydatabasename?characterEncoding=utf8
and user and pass?

and the other stuff may be the name of the connector AdditionalJar: mysql-connector-java-5.1.27-bin
i just found mysql-connector-java-5.1.27.jar and renamed as up (a copy on library) and works i think so.
mysql-connector-java-5.1.27-bin.jar

Well if need more info.

Thanks to all
 
Upvote 0

ocalle

Active Member
Licensed User
Longtime User
What is the mysql config.ini content of the server mysql is running on?
Especially the value for SkipNetworking (or so) is interesting.

U hit in the target @DonManfred , my hosting provider not give me the access to the mysql.ini cuz is a shared hosting

i need install another vps for mysql i think so.

Tnanks all for now.
 
Upvote 0

ocalle

Active Member
Licensed User
Longtime User
Install mysql on your VPS and use this DB
Ok that was Erel's premise in the JRC2 video tutorial.

Thanks
 
Upvote 0
Top