MySQL 8.1 starts giving a deprecation warning for mysql_native_password authentication mechanism

99 views
Skip to first unread message

jpb...@gmail.com

unread,
Jul 21, 2023, 5:57:22 PM7/21/23
to weewx-development
Oh joy. This is going to start causing fits for people whose access to MySQL is done with an older MySQL support module. I'm digging into what PyMySQL supports. Again: oh joy.

Greg

unread,
Jul 21, 2023, 6:51:39 PM7/21/23
to weewx-development
What about marinadb?

Joel Bion

unread,
Jul 21, 2023, 6:57:45 PM7/21/23
to Greg, weewx-development
MariaDB is a great overall alternative, but on reading the MySQL 8.1 compatibility document, I decided rather than shifting database providers to let me keep using a weaker authentication scheme, it is probably a good time to leave behind the weaknesses of the native MySQL authentication plug-in and move to something else.

-Joel

Sent from my iPhone

On Jul 21, 2023, at 3:51 PM, Greg <ubea...@gmail.com> wrote:


What about marinadb?


On Saturday, 22 July 2023 at 07:57:22 UTC+10 jpb...@gmail.com wrote:
Oh joy. This is going to start causing fits for people whose access to MySQL is done with an older MySQL support module. I'm digging into what PyMySQL supports. Again: oh joy.

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/719394f7-d0c4-4b03-80fe-438085a2d830n%40googlegroups.com.

Tom Keffer

unread,
Jul 21, 2023, 7:02:06 PM7/21/23
to jpb...@gmail.com, weewx-development
On some platforms, it's a bit of an adventure installing the cryptography module that the sha256_password or caching_sha2_password authentication depends on. Other than that, it's not too bad.


On Fri, Jul 21, 2023 at 2:57 PM jpb...@gmail.com <jpb...@gmail.com> wrote:
Oh joy. This is going to start causing fits for people whose access to MySQL is done with an older MySQL support module. I'm digging into what PyMySQL supports. Again: oh joy.

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.

Joel Bion

unread,
Jul 22, 2023, 10:07:18 AM7/22/23
to Tom Keffer, weewx-development
Well, after all that it took 5 minutes to add the correct Python modules, 5 minutes to learn the right SQL commands to change the password authentication mechanism and about 15 minutes to reboot and test. Easier than I thought!

Sent from my iPhone

On Jul 21, 2023, at 4:02 PM, Tom Keffer <tke...@gmail.com> wrote:



Vince Skahan

unread,
Jul 22, 2023, 5:30:31 PM7/22/23
to weewx-development
It would be nice if you'd post a followup here so the next person knows your solutions....

Joel Bion

unread,
Jul 22, 2023, 6:45:43 PM7/22/23
to Vince Skahan, weewx-development
Sure!

This is what worked for me. It may or may not work for you! BACK UP YOUR DATA and know how to restore it before you begin!

1) do a “pip3 list” to see if you have pycparser, cffi, cryptography. If you are missing any in this list, “pip3 install <pkgname>” for each <pkgname> you don’t have.

2) stop your weewx service.

3) back up your MySQL data - all of it - before continuing. This guide won’t describe how to do that.

4) run the MySQL program as the root user on the mysql database.

5) look at how your users are set up with “select user,host,plugin from user;”

6) if your weewx username is using a plug-in other than mysql_native_password, you’re probably fine and can stop here.

7) if your plug-in is “mysql_native_password” change it with “alter user ‘weewxuser’@‘localhost’ identified with caching_sha2_password by ‘your password’;”
(Don’t use the double-quotes)

8) force changes to take place with “flush privileges;”

9) quit and re-enter mysql program. Issue command on step 5 again to verify changes ‘took.’

10) if they took, then make sure weewx is configured with the correct password for the Weewx user.

11) restart weewx. Look at log files repeatedly to verify writes to your database are happening.

-joel

Sent from my iPhone

On Jul 22, 2023, at 2:30 PM, Vince Skahan <vince...@gmail.com> wrote:

It would be nice if you'd post a followup here so the next person knows your solutions....


On Saturday, July 22, 2023 at 7:07:18 AM UTC-7 Joel Bion wrote:
Well, after all that it took 5 minutes to add the correct Python modules, 5 minutes to learn the right SQL commands to change the password authentication mechanism and about 15 minutes to reboot and test. Easier than I thought!

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages