charles-001 / dolphie

Your single pane of glass for real-time analytics into MySQL/MariaDB & ProxySQL
https://pypi.org/project/dolphie/
GNU General Public License v3.0
589 stars 36 forks source link

Unable to connect #30

Closed xrhstos closed 1 year ago

xrhstos commented 1 year ago

I am having trouble to connect to a Server version: 8.0.33-25 Percona Server.

I have tried everything using .my.cnf file (which reads it) asking for password and with socket.

Nothing works I am getting access denied password of course works. Since its localhost user is root but still.

Thank you.

charles-001 commented 1 year ago

Hi @xrhstos - thanks for reaching out! Hm, that's strange. I haven't heard anyone having issues connecting like that. What's the authentication plugin used for root?

xrhstos commented 1 year ago

Hello thank you for the quick reply. It's mysql_native_password .

charles-001 commented 1 year ago

Have you tried connecting with another account or another server in general? Very strange for it not to be able to connect if the correct password is used.

Can you provide the parameters that you're passing?

xrhstos commented 1 year ago

I have tried connecting from my machine with a % user and SSL certificates (self-singed) also didn't work. Is there anyway I can verbose this to see whats the problem?

charles-001 commented 1 year ago

There's no verbose option unfortunately. Can you provide the parameters you've tried?

xrhstos commented 1 year ago

Here are the the commands I tried locally.

dolphie -h localhost -u root --ask-pass
dolphie -h 127.0.0.1 -u root --ask-pass
dolphie -h 127.0.0.1 -u userdba --ask-pass
dolphie -c /root/.my.cnf 

Also tried with .my.cnf like this:

[client] socket=/var/run/mysqld/mysqld.pid

My .my.cnf I am using is:

[client] user=root host=localhost password="REDACTED_PASSWORD"

charles-001 commented 1 year ago

Yeah, I have no clue. I just installed dolphie on a fresh server and connected perfectly fine with: dolphie -u charles --ask-pass

I'd look permissions or syslog to see if anything stands out. Definitely something weird going on. Just curious, have you tried any other tools, like Innotop?

xrhstos commented 1 year ago

Yeah innotop and mytop work as expected. Here is the output from the /var/log/mysqld.log

[Warning] [MY-013360] [Server] Plugin sha256_password reported: ''sha256_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'

charles-001 commented 1 year ago

I thought maybe it could be due to sha256_password, but I just created a user with that and it worked fine. The fact it works for innotop/mytop (lol, so old) and not Dolphie has me baffled.

xrhstos commented 1 year ago

Using pt-show-grants (percona-toolkit) it seems the user is using the mysql_native_password.

Here is some redacted output from the pt-show-grants: -- Grants for 'root'@'localhost' CREATE USER IF NOT EXISTSroot@localhost; ALTER USERroot@localhostIDENTIFIED WITH 'mysql_native_password'

I also tried it on a fresh VM with MySQL 8.0.32 and it worked. But in current setups it doesn't work and i am trying to find why.

charles-001 commented 1 year ago

You could try cloning this repo and using it with poetry to change the code and dump some variables. My bet on what's your issue is there's something in either your ~/.my.cnf file or ~/.mylogin.cnf that's conflicting with the parameters you're passing.

xrhstos commented 1 year ago

I think I found what is wrong. It seems on my testbed install root user has caching_sha2_password and on the other server is mysql_native_password which seems dolphie doesn't like :(. That's why it worked for you in your default new install you tried. Is there a workaround on this ?

charles-001 commented 1 year ago

I just tested caching_sha2_password + mysql_native_password and they both work fine. I don't think that's the issue.

xrhstos commented 1 year ago

You tried with .my.cnf or you passed the connection details?

charles-001 commented 1 year ago

I use parameters to pass connection details

xrhstos commented 1 year ago

Thank you charles. It seems there is something from my end. I am closing this and will investigate further.

charles-001 commented 1 year ago

You're welcome! When you find out what it is, let me know :)