mysql log into 8.4 to change to caching_sha2_password- can't be done

I took a working system and upgraded mysql to
# /usr/local/etc/mysql% mysql -V
mysql Ver 8.4.2 for FreeBSD14.1 on amd64 (Source distribution)

Now I can't log due to the:
ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded

In a fresh install on another new server from scratch, I created the passwords and altered them to caching_sha2_password and that works. And If I could log into the upgraded server which is now upgraded to 8.4.2, I could run the ALTER USER to change this. But my "catch-22" is I can't log in to make that change. It looks like if you missed the chance to change the password caching type, and then upgraded mysql to 8.4, you have to delete everything and start from scratch ?

Is there any way to alter the password type without a major re-do and re-load ? Is there any way to log into my 8.4 version mysql ?
 
prompt> /home/pete% mysql --port=3307 --host=127.0.0.1 --skip-grant-tables -u <usrename> -p
mysql: [ERROR] unknown option '--skip-grant-tables'.
:(
Put a skip-grant-tables under [mysql] in the .cnf, now another error (can't connect). working on it...
the problem now is : ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3307' (61)
I see the server running with ps but don't see the port open with a
Stopped the server, did a "one-start" and now I can see the port with netstat, the pid file matches ps -ax but I still can't connect to the server.
 
Definitely doable: https://dev.mysql.com/doc/refman/8.4/en/resetting-permissions.html

Might have to rework slightly for FreeBSD.

Strongly recommend you set up a test box with the older version of MySQL and some test database/tables. Then go through the upgrade steps on that test system; see if you get stuck the same way (you should) and then try and root password reset.

If that works you should have good model for your new instance.

I've done this sort of thing, but it was on MySQL 8.0 rather than 8.4.
 
Code:
mysql
is the client not the server which is why it doesn't recognise the command. Do this instead
Code:
mysqld_safe --skip-grant-tables &
mysql -u root
then makes the password changes, flush privileges and restart the server as normal
 
This machine has two instances of MySql running on it. One (which happens to be Ram Disk based) is at port 3306, the other is a "classic" that stores everything on a SSD on port 3307. I'm not sure how to run msqld_safe and specify which system I'm referring to.
I updated my post above. Right now, the problem has morphed into a can't connect even though I can see a open socket with netstat.
Also, I had to re-boot the server to get MySql running again, and that boot was with the skip-grant-tables in the .cnf file. So in theory, maybe, if I can connect I can alter the password entry.
tried this to connect: mysql --port=3306 -u root -p entered the password and got:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
and this was with the skip-grant-tables in the .cnf file in the [mysql] section.
 
This is not going well, so I'm going to delete the MySql directory and start from scratch. My other system has all the tables in it, and I can restore the database from there.
This upgrade of a working system from FreeBsd 13.3 to 14.1, mysql from 8.0 to 8.4, php from 8.0 to 8.3, and the ill-fated zpool update that corrupted boot blocks has been really rough (5 days vs. a few hours when I've done upgrades multiple times in the last 10 years. Additionally not a FreeBSD issue but Google Maps also introduces some changes that keyed in on the Apace 24 version (that was also upgraded) that broke all the web pages that use Google Maps.

Another curious observation is I have 2 systems, exact same hardware. Both have the two instances of MySql running, one in a RamDisk and on on the SSD. The one I brought up from scratch about a month ago can load up the RamDisk MySql on boot in 9.8 seconds. This server I'm working on upgrading now takes 12 seconds to do the same thing. I'm thinking that there were some pieces that didn't get updated somehow. If re-installing the SSD MySql does not work, then I'll nuke it all and start from scratch. That way I know everything will work, and I've got the newly created system to import config and other files from.

I've nuked and restored the database, setting up the passwords again and using the cachine_sha2_password. It's all up and running normally now, took about 30 minutes. I wish I could have figured out how to fixe it otherwise in case others have this problem.
I'm really liking that I wrote small programs to do both full backups and restores of both databases, and for the Ramdisk based system to do partial dumps back from Ram to SSD and have the ability to create partial dumps of any information in the database that changed out to a file that can then be sent to an offsite backup machine which can then update it's copy of the database. That utility can also transfer tables between the databases and do per-table dump and restore to help with software development.
This is how the digital twin system will get updated and be a copy of the production system every day, so you are always testing and developing on current information. And with one command on each serve, you can update the twin typically in less that a few minutes if you need to work on a bug based on some event that just happened.

I had to take the time efficient way out, all the methods that worked for me in the past and the various suggestions people were kind enough to make didn't seem to work.
Thanks to all for your help !
 
That's a lot of moving parts to upgrade all at once. And everything seems to be changing at a rate of knots these days.

The slower server might indicate hardware issues?

I assume things will go badly and have a test system or three and go through the upgrade cycle a few times on the test system(s) to be as sure as I can (nothing is exactly the same) that things will work. I'd also split into chunks - do the OS, let it bed down for at least a week, then Apache/PHP, bed it down, and finally MySQL. But that's of no use to you now.
 
Richard you are correct. I was under time pressure and had to juggle chainsaws with the throttles taped to "full". I tried to fix things (with a lot of help from this forum, for which I am grateful) because "reload and reboot" doesn't really fix problems. With the twin system working, I can take the approach you advocate. A little bit at a time with a break in between each. It would be nice to have 2 or 3 test systems, but these big servers are a bit pricey.

I updated my last post, check it out for some more info on the re-install process. I save myself a lot of time and headaches by building up utilities to help maintain the dual database systems. I also have a big "cheat sheet" that I follow to set up a new system, what I did this evening was to follow the steps for bringing up the SSD based database. The older you get, the better you document...

I've booted the system and it's still a bit slow. While they are twins, they were ordered about 10 months apart. But they are the same processor/motherboard/memory. It could also be the SSDs, even though they are the same part number (Samsung 4 TB MLC-2 2.5" SATA) they were about 15 months apart on their date code. Got the 1st batch from a server supplier who had a surplus, the 2nd were full price. Improvements in the firmware could account for the difference. Another change could be the ZFS. While I did the zroot update (which was messy as the boot partitions go scrogged), IDK if that made ZFS the same as a "all new from scratch" build. It's still a fast system, a about a factor 3 times faster than the server it replaces. The Intel Gold 6246R 3.4GHz 16 core 36.3MB L3 with 96GB on 6 memory lanes is fast.
Next step is to wipe clean and re do 3 different variants of the Intel Atom servers for lights loads in-vehicle use. They've been up for 3-4 years no with no problems. And like the big system, there will be a twin for the units "in the field" (literally).

Thanks for your help and input.
 
It would be nice to have 2 or 3 test systems, but these big servers are a bit pricey.
Yes, that's what I was trying to get at with the "(nothing is exactly the same)" part - you can try and get as close as you can to the server hardware, but sometimes that's not really very close at all (unless someone has very deep pockets). But at least same OS level, versions of ports (Apache, PHP, MySQL) and file system.

But definitely one component at a time otherwise you end up trying to fight ten fires at once and you can't be sure if your changes for one thing are upsetting or fixing another thing and it all gets messy and miserable very quickly.

Don't SSDs do reprovisioning or something (might be the wrong word there)? So if there are some bad areas, the firmware will move things around a bit? But would that make such a noticeable difference?

I've not had much experience with ZFS so can't offer much help there. But I've had a dreadful experience with Dell hardware RAID this year so starting to learn more about ZFS and trying systems using it.

On the MySQL root password:
I wish I could have figured out how to fixe it otherwise in case others have this problem.
Did you try anything on the MySQL link I sent? that's definitely worked for me in the past, but I've not tried MySQL 8.4 yet.
 
The small Atom systems with different configurations are close to what you describe. And indeed, you get much better insight in to what the performance of the pieces are when you can take your time.
I did look at the link you provided. I made some changes to the rc.d file that brings up the mysql SSD database without much luck. There was some flakeyness with the server port being up but the mysql client couldn't connect, which is what finally drove me to just "delete-reInstall". Don't like it, but. My core background is hardware and firmware, started with Unix in '76 at Purdue. (and a PDP-8 in 1972). I only wish my testing in software was as good as it is in hardware and embedded software...

The SSDs do "wear leveling". This spreads the write cycles around on the flash memory evenly. An MLC-2 can write a given flash bank about 1200 times. The MLC-2 means 2 bits per cell stored as an analog voltage. Most SSDs in consumer stuff (and perhaps in the big SSD long term storage devices) are MLC-3, which is 3 bits per cell and can write a flash bank about 300 times. Erasing and writing the cells causes the degradation that limits the number of write cycles you can do. The new drives may also have abilities to re-write blocks if they have not been written in a while, but this is some new stuff. It's a concern for me because I'm going for 20 year life. Not so much for a laptop or desktop that will be relaced in 4 to 8 years for most people. The 'trim" capacities in FreeBsd are also a big help. It tells the SSD which blocks are no longer in use by the OS. This maximizes the effectiveness of wear leveling.
For decades the spinning rust was a dream device. You can read and write forever, you just need to replace them eventually. Kinda like a well pump- it will pump forever but only start so many times. So the no moving parts of SSDs, their zero latencies, physical ruggedness and size are a win but it's taking some time for the rest of a computer systems to adjust how things are done so they can really take advantage of SSDs. There are people working on storage that is fast and can be read/write forever, time will tell. In my embedded work I really like the small processors with MRAM (magnetic memory, reads are destructive, just like core "everything old is new again".) But those are small < 65 KB devices. They are wickedly fun to program and optimize.
The total storage on the 4TB of SSD in the system right now is about 5GB. Of course that will grow, but even if it reached 500GB the number of writes would be about 1200 x 8 or 10K writes per block. Not bad. At 50GB that goes to 100K writes of all your data.
Note also for this mobile use, the lower power of the SSD (especially since they are idle 99+% of the time) is a big win too when compared to spinning rust. The deployable servers draw about 25 watts most of the time, and can go to about 50W if all the cores are really cooking, memory is changing and the SSDs are storying stuff.

I hope to write up what I'm doing both with the "database in a RamDisk" and the "mobile server" stuff. IDK if there's a way to submit that to this forum or not. Hopefully someday. Just like I can look at a schematic and always ask good questions, I'm sure same is true for software. Especially mine. It looks like an embedded C programmer trapped in an object orient environment. Todays decisions not withstanding, at least most of the time I do OK on testing.

Wrote a lot here, hope that's OK....
 
Back
Top