MySQL cannot connect

Post Reply
F4BPO
Old Man
Posts: 192
Joined: 22 Jan 2013, 10:49
Location: Vietnam

MySQL cannot connect

Post by F4BPO »

Hi Daniele, Terry,

We have a problem with MySQL for some time.
A friend is having exactly the same issue as well.

This is the error message we have while using MariaDB (10.11.4-MariaDB)
08:47:36.966 Info: [DbMysql] : MYSQL deploying database log_xv9bpo START
08:47:36.969 Info: [DbMysql] : Connection string: Server=10.10.10.15;Port=3306;User ID=root;Password=***********;Pooling=false;SslMode=None
08:47:36.971 Info: [DbMysql] : Script loaded
08:47:36.973 Debug: [FwFile][WriteFile] : Begin writing text file D:\PERSO\Seafile\Radio\Log4OMv2\config\log\createDatabase_log_xv9bpo.sql
08:47:36.975 Debug: [FwFile][WriteFile] : Text file write completed D:\PERSO\Seafile\Radio\Log4OMv2\config\log\createDatabase_log_xv9bpo.sql
08:47:36.984 Info: [DbMysql] : MySQL creation file is saved here: D:\PERSO\Seafile\Radio\Log4OMv2\config\log\createDatabase_log_xv9bpo.sql
08:47:36.987 Info: [DbMysql] : Opening connection...
08:47:37 Error: [DbMysql][Deploy] : MYSQL Error while deploying database
[EXCEPTION] Impossible d'effectuer un cast d'un objet de DBNull en d'autres types.
The exception is in French but it just says: Cannot perform a cast of a DBNull object into another type.
So I presume a cast is performed in the code to change a type into another type which cannot succeed due to the fact the first object to convert is a DBNull.

I did not use MySQL for a long time so not sure when this issue started but we cannot use MySQL anymore on our side due to this.

And while trying to connect to an existing database here is the error:
[EXCEPTION] Authentication to host '10.10.10.15' for user 'xv9bpoUser' using method 'mysql_native_password' failed with message: Access denied for user 'xv9bpoUser'@'10.10.10.100' (using password: YES)
I am 100% sure of the password as I use the same to connect to PhpMyAdmin without any issue, also tried with MariaDB root user.

Not sure what changed in Log4OM but no more MySQl for me.

Is there anyone facing this issue as well ?

Thanks
73 de XV9Q Greg
ak7vv
Novice Class
Posts: 11
Joined: 13 Nov 2023, 07:50
Location: Redmond, WA, USA
Contact:

Re: MySQL cannot connect

Post by ak7vv »

I have the exact same issue it seems, with the error in English ;).. Fresh install of log4om2, db connectivity is fine (credentials, etc), MariaDB 11.2.

When I try to create the database, I get this:

Code: Select all

03:49:53.089 Info:          [DbMysql] : MYSQL deploying database log4om2 START
03:49:53.095 Trace:         [DbMysql][dje_z4ESDKY8QSA35422_ejd] : Connection string: Server=docker.local;Port=3306;User ID=root;Password=(n3ctar#);Pooling=false;SslMode=None
03:49:53.123 Info:          [DbMysql] : Connection string: Server=docker.local;Port=3306;User ID=root;Password=(n3ctar#);Pooling=false;SslMode=None
03:49:53.137 Info:          [DbMysql] : Script loaded
03:49:53.152 Debug:         [FwFile][WriteFile] : Begin writing text file C:\Users\chris\AppData\Roaming\Log4OM2\log\createDatabase_log4om2.sql
03:49:53.168 Debug:         [FwFile][WriteFile] : Text file write completed C:\Users\chris\AppData\Roaming\Log4OM2\log\createDatabase_log4om2.sql
03:49:53.177 Info:          [DbMysql] : MySQL creation file is saved here: C:\Users\chris\AppData\Roaming\Log4OM2\log\createDatabase_log4om2.sql
03:49:53.189 Trace:         [DbMysql][dje_z4ESDKY8QSA35422_ejd] : Connection string: Server=docker.local;Port=3306;User ID=root;Password=(n3ctar#);Pooling=false;SslMode=None
03:49:53.227 Info:          [DbMysql] : Opening connection...
03:49:53.359 Error:         [DbMysql][Deploy] : MYSQL Error while deploying database
                                      [EXCEPTION] Object cannot be cast from DBNull to other types.
This is the .sql that was created:
createDatabase_log4om2.sql.txt
(8.73 KiB) Downloaded 113 times
At the end, the database does get created and there is a log and an information table. I don't know enough to check if it was created correctly, but when I run the SQL statements interactively, they do complete with only warnings in HeidiSQL.

I also see this when I do the connection check:

Code: Select all

04:19:52.452 Trace:         [DbMysql][dje_zT22TY58JP7JBPLQ_ejd] : Connection string: Server=docker.local;Port=3306;Database=log4om2;User ID=log4om2User;Password=log4om2User;Pooling=false;SslMode=None
04:19:52.552 Error:         [DbMysql][Connect] : [EXCEPTION] Object cannot be cast from DBNull to other types.
04:19:52.561 Warn:          [DatabaseManagement][TestConnection] : Connection not valid
Both times the log records this exception "Object cannot be cast from DBNull to other types.".

Btw: I am far from a *SQL expert, but I do think the first three lines of the script that gets created are not necessary. See this article: https://docs.oracle.com/cd/E19078-01/my ... 0performed. There is no large import performed and there doesn't appear to be any appreciable performance difference when creating empty tables.

Thanks,
Christian
ak7vv
Novice Class
Posts: 11
Joined: 13 Nov 2023, 07:50
Location: Redmond, WA, USA
Contact:

Re: MySQL cannot connect

Post by ak7vv »

Related thread: https://forum.log4om.com/viewtopic.php? ... ect#p43835

Last post suggests that Log4OM2 is incompatible with anything newer than 10.6.
Post Reply