B4J Question CloudKVS - synchronized key / value store - MySQL Learn

Reinierus

Member
Licensed User
Longtime User
Hello.
I have worked with SQLite databases in the past and now I need to make a app with a database in the cloud, to write a read data from Android and Windows clients.
I see that this post can help me to learn about the solution: https://www.b4x.com/android/forum/t...kvs-synchronized-key-value-store-mysql.69042/
I already made a database in a site:
1589416419581.png

So, as I can see, in this part I need to put the server information:
B4X:
Public Sub Init

    Dim user As String = "YYYYYYYY"
    Dim PW As String =  "XXXXXXXXX"
    Dim myDB As String = "ZZZZZZ"
    Dim serverPort As String = "65.19.141.67:3306" 'Here we put the web address??? With that port??'
    Log( $"jdbc:mysql://${serverPort}/${myDB}?"$ & _
             $"user=${user}&password=${PW}"$)
    sql.Initialize("com.mysql.jdbc.Driver",  _
             $"jdbc:mysql://${serverPort}/${myDB}?"$ & _
             $"user=${user}&password=${PW}"$)
If I do that, I get this message:
Wed May 13 18:24:04 CST 2020 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

Can somebody help me?

Thanks a lot
 

Reinierus

Member
Licensed User
Longtime User
And it doesn't matter which user and password I put, always get this error:
java.sql.SQLException: Access denied for user 'YYYYYYYYYYYYY'@'nnn.nnn.nnn.nnn' (using password: YES)
what is the format that we need to send the user and password?
The server is asking me that I need to validate the IP address of the clients?

Thanks
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
First post: As it says, the default of your particular version ,and any later version, of MySQL defaults to encrypted connections. The issue is, that out of the box, MySQL does not have a certificate to perform that encryption, you have to provide that. If you do not want to go through the steps to enable SSL for the connection, then add useSSL=false to your JDBC connection string. Since it is just a warning, you can also just ignore it (you don't have to do anything, MySQL will just keep warning you)

Second post: Out of the box, MySQL does not allow connections from another computer. You have to enable remote connection for the user. The following link may help you with that issue: https://stackoverflow.com/questions...-access-of-mysql-database-from-any-ip-address
 
Upvote 0

Reinierus

Member
Licensed User
Longtime User
I really thank you. In the cPanel there is a Remote Configuration options and there we can add the IPs address.

Best Regards
 
Upvote 0

Reinierus

Member
Licensed User
Longtime User
You should probably use jRDC2 instead of CloudKVS.

Hello Erel.
I trying with jRDC2, but it is not clear for me.
As I understand, I need to install my server app:
1590014754395.png

on the site of the database is:
1590014830405.png

But I don't know how to do that.

In my own test, if I try to connect and read data from a B4J client app directly, it works:
1590015045910.png

But I don't know how to do this in a B4A app or if that is the right way
Can someone with patience explain me?

Thanks a lot!!!
 

Attachments

  • 1590014997028.png
    1590014997028.png
    186.1 KB · Views: 153
Upvote 0
Top