New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version #5889
Comments
Thanks for the report, @bgabler
This particular command uses WordPress exclusively for database interactions. My guess is that the warning is coming from WordPress itself, or a custom |
Hi @danielbachhuber, Thanks for taking a look :) It happens to every site on our platform and we don’t use a custom drop in. It seems to be any call we use with WP cli that requires reading from the db. Sounds like it may be related to WP Core, just odd we don’t see it in any error logs from HTTP requests. |
Do you have |
Nope, everything I read online states this comes directly from MySQL server as its going to be deprecated in future releases all together, but only when using mysqlnd client 8.0.34+. If we use an older mysqlnd client library, it does not occur. If you compile PHP with that, you should be able to reproduce. |
I am seeing this error now as well and I did not make any changes. I am asking the hosting service if changes were made. But this just started this morning. MySQL version: 8.0.36, PHP: 7.4, WP version: 6.2.3 |
Me too : Constant deprecated warning output when running a WP bash installation script: Excerpt follows:
|
We have a hosting company and I am receiving an average of 400 emails a day with this message. (cron jobs) All with different wordpress (different templates, different plugins, different versions...). So it seems to be a generalized problem
mysql Ver 8.0.36 |
I did some research into this, and to me it looks like this is not something WP-CLI is causing or that WP-CLI can fix. Since the WP-CLI does not add this option to database calls, and I did not find any traces of it in WordPress Core either. So this either comes from extensions (plugins/themes), which is unlikely, or more probably it comes from the environment. It might be set in some configuration files, or it could be automatically added by certain driver libraries. Most users affected by this have reported that it went away after certain system updates. |
This has started happening in two of my sites. Moodle with PHP 8.x and WordPress with PHP 7.4. I guess the hoster has change something but I don't know what and I don't know what to say them what to check. I'll pay atention to this issue. Thank you. |
Bug Report
Describe the current, buggy behavior
When working with MySQL Ver 8.0.35, WP CLI is throwing the following warning when running MySQL related commands:
According to the documentation, beginning with MySQL 8.0.34, the automatic reconnection feature is deprecated.
The related MYSQL_OPT_RECONNECT option is still available but now returns a deprecation warning to the standard error output if your application calls the mysql_get_option() or mysql_options() function with the option, even when setting it to false.
Expect automatic reconnection functionality to be removed in a future version of MySQL.
https://dev.mysql.com/doc/c-api/8.0/en/c-api-auto-reconnect.html
https://dev.mysql.com/doc/c-api/8.0/en/mysql-options.html
Describe how other contributors can replicate this bug
The bug currently happens with the latest version of WP CLI on the following env:
Describe what you expect as the correct outcome
Support for MySQL 8.0.34+ and MySQL 8.1.0+ client libraries as well as future releases that remove automatic-reconnection control.
Let us know what environment you are running this on
The text was updated successfully, but these errors were encountered: