[Gambas-user] Mysql strange behaviour on open database with gambas 3.13

Jorge Carrión shordi at gmail.com
Tue Apr 30 20:50:22 CEST 2019


Since this morning (with the new Gambas 3.13 and the update of the
MysqlClient from Linuxmint repositories in Abr, 29) I can't connect with
our MySql server.
This is the code (more of less) we use until now:
with myHcon
    .Type = "mysql"
    .host = myhost
    .port = 3306
    .User = "myuser"
    .Password = "mypassword"
    .Name = "mydatabasename"
    Try .Open
    If Error Then Print Error.Text
    If Not .opened Then
        Message.Error("No Connection")
        Return False
    Endif
This code doesn't work and generates this error:
"Cannot open database: Can't connect to MySQL server on '<ServerIPhere>'
(4)"

*BUT *If wait one second and try again then all works fine:
with myHcon
    .Type = "mysql"
    .host = myhost
    .port = 3306
    .User = "myuser"
    .Password = "mypassword"
    .Name = "mydatabasename"
    Try .Open
    If Error Then Print Error.Text
    If Not .opened Then
        wait 1
        Try .Open
         if not .opened then
               Message.Error("No Connection")
               Return False
         endif
    Endif
This code shows the error and connect fine the second time...

In error log of mysql server appears this message each time the connection
is failure:
"2019-04-30T18:43:07.166136Z 11664 [Note] Got an error reading
communication packets"

I don't understand nothing.

Best Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190430/fa7c2944/attachment.html>


More information about the User mailing list