Connecting to MySQL 8

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
MJFShark
Expert Boarder
Expert Boarder
Posts: 211
Joined: 04.06.2020, 13:59

Connecting to MySQL 8

Post by MJFShark »

Hi All!

I'm using Zeoslib 8 and trying to connect to a new MySQL 8 test database on a remote Ubuntu server. I've got everything working the way I think it should, however whenever I try to connect to it I get the error:

SQL Error:
SSL connection error: unknown error number
Code: 2026 Message: Connect to "test" as user "mark"

I have require_secure_transport off on the server side. I'm trying to connect using "libmysql.dll" version 6.1.11.

I know this isn't a lot to go on, but any suggestions on getting this working would be appreciated. I'm wondering if I need a newer client dll.

-Mark
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 765
Joined: 18.11.2018, 17:37
Location: Hungary

Re: Connecting to MySQL 8

Post by aehimself »

Hello Mark,

2026 seems to be an SSL-related error message:

https://forums.mysql.com/read.php?30,659272,659272
ERROR 2026 (HY000): SSL connection error: SSL is required but the server doesn't support it
Check whether you have valid certificates installed and if you have the options added in TZConnection to use SSL for the connection. I don't have SSL turned on on my database as it is not reachable from other network segments but you also can give libmariadb.dll a try to see if it is driver-related.
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
MJFShark
Expert Boarder
Expert Boarder
Posts: 211
Joined: 04.06.2020, 13:59

Re: Connecting to MySQL 8

Post by MJFShark »

I finally got back to this and got connected. I ended up having to turn off ssl (ssl=0 in mysqld.cnf) but I also had to change the "identified with" clause in create user to mysql_native_password (apparently migrated databases will have this as the default for existing users.) Looking at the MySQL connector docs for version 8 it appears that the C connector has been replaced with the c++ connector. What does that mean moving forward for MySQL and Zeoslib? I'd also be interested if anyone's been able to connect to MySQL 8 without needing the changes I made. Thanks!

-Mark
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 765
Joined: 18.11.2018, 17:37
Location: Hungary

Re: Connecting to MySQL 8

Post by aehimself »

Use the MariaDB driver. That is being kept up to date and is fully compatible with MySQL.
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
MJFShark
Expert Boarder
Expert Boarder
Posts: 211
Joined: 04.06.2020, 13:59

Re: Connecting to MySQL 8

Post by MJFShark »

Aha! Thanks for pointing that out! After switching to the MariaDB connector and adding the MYSQL_PLUGIN_DIR property I was able to connect to MySQL 8 without needing to turn off ssl and without having to change the default plugin. Nice!

-Mark
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 765
Joined: 18.11.2018, 17:37
Location: Hungary

Re: Connecting to MySQL 8

Post by aehimself »

Mark,

Glad it helped! I remember people having difficulties with SSL and libmysql.dll; most of them simply switched to MariaDB driver.
It also worths to note that Orace stopped compiling the 32 bit version; 64-bit is always included in the MySQL server. Download the community edition and extract the libmysql.dll file only: you just got yourself an up-to-date version.
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 765
Joined: 18.11.2018, 17:37
Location: Hungary

Re: Connecting to MySQL 8

Post by aehimself »

Misread, nothing...
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
Post Reply