Newbie: ssh session with mysql

I set up an ssh tunnel just fine, but then learned I could not connect to my mysql database through the normal command line connect string - ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/run/mysqld/mysqld.sock’

How do I fix this?

mysql -u someuser -p somepassword

Hi, I’m pretty stuck here… Can anyone help?

How does this relate to Cloudflare? Are you trying to do mysql over a cloudflared ssh tunnel?

Yes, I have a Cloudflare tunnel set up to ssh via the browser. I can issue simple commands, but I can’t connect to my database issuing a simple command: mysql -u username -p password. If I do this, I get the socket error message: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/run/mysqld/mysqld.sock’…

Locally, this works just fine.

So Cloudflare is stopping it somehow…

In order to do SQL over SSH, you will probably need to not use browser rendered ssh and use native rendered ssh SSH · Cloudflare Zero Trust docs

2 Likes

Thanks - it worked

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.