How to connect to mySQL- caching_sha2_password error 2058

I’m quite new to MySQL. Very new to LibreOffice Used it, limited ways, under OpenOffice, though.

I (think!) I have a “healthy” simple little MySQL database. It “works” via the MySql Workbench, anyway. (Environment details later)

I was trying to connect to that through LibreOffice. In OpenOffice, I used Base as the “front end”, “spoke” to my MySQL database “through” OO.

Really simple scenario… only a single computer involved. One user. Nothing fancy.

==
I am so confused. I SWEAR that when I did the following earlier, I got…

“Connection… could not be established.
Plugin sha256_password…
module could not be found.”

But later, when I tried to do the same things again… while writing this up… all was well.

So this post is just a heads up regarding the sha_password error message.

I don’t know how I got it. I don’t know why it went away. My work is far from done, but here are a few things that are going on…

  • I may have tried to get away with not ticking the “password required” box when I knew full well there is a password on the database. But I think that I would then have tried again WITH the tick.

  • At one point, I was trying to access a database that wasn’t yet installed on the MySQL server involved. Duh. But why would that throw a “sha_password” message? And I also got it trying to access a database that IS (and was!) on the server

  • I may have put 127.0.0.0 in as the server’s address when trying to connect to the database, “going in” via launching LO Base “empty”, i.e NOT by double-clicking on any .odb file. In my system, it should be 127.0.0.1 I got that, and the port, from MySQL Workbench, “Database/ Manage connections”.

  • I may not have had MySQL Wrokbench running, in the session when I was getting the error. Why would that matter?

So… If you get the “sha_password” message, there are a few things that may be relevant. (I didn’t find much on it with Google Search.) None make sense. But if we will use computers… Sigh.

My system? Windows 10, 64-bit. vers 2004 build 19041.508 // MySQL80 // LibreOffice 6.3.6.2 (x64)


The rest is possibly of little interest… but I’d typed 80% of it before my question changed, so, if you wondered what I meant about using LibreOffice as a front end for a MySQL database, here goes. There’s more on this at a page I wrote about MySQL via Libre Office… but had forgotten about! (It doesn’t address the problem.) (I also offer an older page, covering other aspects of the issues.)

Remember… before you start, you need MySQL installed on the PC you will use for the LibreOffice stuff, the server running, and a database running which you can “play with” via MySQL Workbench. Absent any of those, and you are not ready to start the following.

I got the MySql server running. Lauched LO. Asked (Database wizard) to connect to existing database. Selected “MySQL”, clicked “Next”

Step 2, Database wizard: Set up MySQL connection. Asked to “connect directly” i.e. use the software that (now) comes as part of LibreOffice. (You will see posts from The Olden Days that say you need a plug in. You don’t. (I don’t want to use ODBC or JDBC… More layers, more momponents: More things to go wrong. More features, maybe. Fewer bugs, maybe. But I’d rather work with “simple”, if I can get it to meet my simple wants.)

Step 3: Database name… as used in MySQL Workbench

  • Server/port: 127.0.0.1 / 3306… the values for the database given by Workbench menu choice Database/Manage Connections

Step 4: User name: I used a (powerful) seondary user a/c OF THE SERVER that I had previously set up (using MySQL Workbench).

  • Ticked “password required”
  • Use the “Test Connection” button! You will be asked for the user’s password.
  • Clicked “next”…

Step 5: I said “Yes, register”, and told it to open database for editing.

Clicked Finish.

That took me to the LO Base “Save As” where I “saved the database”… or so you might think, if unfamiliar with the idea of Base as a /front end/ for a database served by other means. We’re really just saving how we connect, and eventually (I think) things like local queries and report specs.

After I’d navigated to the right folder, given the new .odb a name, and saved. I got then was asked for the password into the server user I’d specified earlier. (The dialog box can get “lost” behind things, by the way… go to your task bar, and get to it that way, if lost.

And I was “in”. NOW using the database was indistinguishable from the simple case of using one of the embedded engines.

So why the hassle? So I can use the MySqldump command.

Also… once I recover from this “simple” use of a MySQL server, the next opportunities include…

… using a MySQL server on another machine, across my LAN, or maybe even across the internet.
… having multiple users accessing a database, concurrently.

Try doing either of those by other means!