Disable MySQL secure_auth client option with ZeosLib - mysql

I'm trying to connect to a remote MySQL server and i get this exception error:
*Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)*
I'm tried to disable the "secure_auth" option by adding the string "MYSQL_SECURE_AUTH=false" to the TZConnection properties, but i get the same error.
I'm using ZeosLib 7.0.4 and Delphi 7. The server has MySQL 5.0.95

Problem solved!
The server is MySQL 5.0.95 (secure_auth disabled) and I was using libmysql.dll 5.6.11 (secure_auth enabled by default). Placing the libmysql.dll 5.0 in the app folder solved it.
I don't understand yet why i can't change the "MYSQL_SECURE_AUTH" at TZConnection.properties.

Related

Maxscale not allowed to connect mysql8 with java application

I have a mysql 8.0.3 database over top of that maxscale server is running when i tried to connect with that mysql jdbc driver this error is coming unknown system variable 'query_cache_size'. But when i tried to connect directly to database is working for me. query_cache_size parameters removed from mysql 8.
The query cache has been deprecated. BTW 8.0.3 is a very old version (4 years) and was pre-general availability (a release candidate) so please do not use it for production.
Edit: With MXS-2890 fixed, you should now be able to configure version_string=8.0.16-mysql in MaxScale to solve this problem
This is most likely caused by the following bug: https://jira.mariadb.org/browse/MXS-2890
The MariaDB JDBC connector should not suffer from this problem which means installing it instead of the MySQL JDBC connector can be used as a workaround.
In your /etc/maxscale.cnf you can add version_string=5.6
[Read-Write-Service]
type=service
router=readwritesplit
servers=master
version_string=5.6
user=user
password=********```
after that i am able to access mysql8 on top of maxscale server.

Cannot connect MySQL Server to Netbeans

I can't connect to my database using the "new connection" option by right-clicking on Databases in the services tab. I get the following error:
Error Image
Here is information about the server to help with a solution:
Server info
Additional server info
The password I have saved in keychain for the server is "password1" and the connection isn't working even though I entered that.
Ok I finally figured it out. I had to update the MySQL connector driver for Netbeans. I had version "mysql-connector-java-5.1.23-bin" installed and needed to add the new driver "mysql-connector-java-8.0.18.jar" to match the version of MySQL Workbench that I have.

Authentication problem with mysql 8 using qt

I am developing a qt (5.12.2) application which can connect to a mysql server. Recently i tried to connect to a mysql 8 server. I was unable to connect, and got the following error message:
Authentication plugin 'caching_sha2_password' cannot be loaded: The specified module could not be found.
After some digging, i found out that the problem was because of the new encryption implemented in mysql 8.
One workaround to this problem was to set the server to the legacy authentication method.
Is there a solution without switching back to the legacy authentication?
There are 2 possible problems which can cause this problem.
You are using the old way and connect with QMYSQL driver using the
MySQL Connector/C (libmysqlclient.dll) connector which not supports
MySQL 8 and the new authentication method.
The second way is that you are using the QODBC driver with an
older release(<8.0) which not supports the new authentication
method.
You can easily solve this problem by switching or upgrading to the latest QODBC driver. You can download the latest version from the MySQL download page. With this little example and with the right connector it will work.
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName("Driver={MySQL ODBC 8.0 Unicode Driver};Server=example.com;Database=test;Uid=user;Port=3306;Pwd=password;WSID=.");
if (!db.open()) {
qDebug() << db.lastError().text();
} else {
qDebug("success");
}

Fresh Lucee 5.2.7.63 install unable to connect to fresh MySQL 8 install

I recently setup a new AWS server to be used as a web server for some small utility apps. It's running Windows 2012. I then:
Installed Chrome
Installed Lucee 5.2.7.63 using installer
Installed MySQL 8.0.11 Community Edition using installer
Installed MySQL Workbench
Created a new schema via MySQL Workbench (which connects to MySQL just fine)
Created a datasource in Lucee server administrator which fails verification with:
Could not create connection to database server.
I tried using both a Lucee specific user, and the root user, and neither worked. When I checked the Lucee error log I saw this occur several times, once for each verification attempt:
Wed Jul 18 19:52:08 UTC 2018 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.
My guess is that I either need to force Lucee to use SSL, or force MySQL to allow a non SSL connection. Unfortunately, the Lucee administrator has no option related to SSL and doesn't allow me to modify the connect string manually. And I'm unsure how to alter settings for MySQL as I can't seem to find a my.ini file anymore.
The last time I setup a server was with MySQL 5.7 and I had no problems from start to finish, so I assume this must be a MySQL 5.8+ issue, but that is contradicted by the error message.
Update
In the end I decided to uninstall MySQL 8 and install MySQL 5.7. It was difficult to download the installer for 5.7 (I got 8 again the first time for some reason), and then there was a conflict with the MySQL installer, that didn't want to recognize the 5.7 I downloaded, but after getting through it all Lucee began connecting immediately with no problem.
I would still be interested in a solution, though, so that I can use MySQL 8 in the future.
You could try defining the datasource in your Application.cfc which will give you more control over the connection parameters. For example:
this.datasource = {
database: "mydatabase"
,type: "mysql"
,host: "hostname"
,port: 3306
,username: "myusername"
,password: "encryptedpassword"
,custom: {
useSSL: false
,useUnicode: true
,characterEncoding: "UTF-8"
}
};

MySQL/VB.NET - An address incompatible with the requested protocol was used

I have a trivial VB script which I am using to connect to a MySQL database on a Windows Server (2012 R2).
It's all super simple, out of the box "connect to MySql example" stuff.
I have verified that MySQL is listening on all local IPV4 addresses. I can connect with MySQL workbench with the same parameters. Yet I get a weird error when connecting via my program:
An address incompatible with the requested protocol was used
My connect string is as follows:
"server=127.0.0.1;database=test;uid=xx;pwd=xx"
It appears the connection tries to use IPV6 when connecting. How is this possible?
I suspect some kind of firewall is modifying or blocking my network connection, but it is a "new" machine for me and I don't know what's installed.
The problem was due to an old MySQL Connector DLL (MySQL.Data.dll) version which was either incompatible with Windows (hence the networking error message) or the version of MySQL I'm running. After upgrading the dll, the connection worked properly.
This may help out someone who has a similar problem, as the error is highly misleading.