Skip to content

killing query kills ssh connection instead #2102

Description

@mentalstring

When I use a ssh_jump (great feature!), stopping a running query seems to kill the ssh tunnel instead.

I connect to a remote server using a DSN along these lines:

mysql://user@localhost/database?socket=%2Fvar%2Frun%2Fmysqld%2Fmysqld.sock&ssh_jump=user@db-server

This connects and works fine. However, if I happen to abort a long running query with ^C, at that point it immediately says:

Encountered error while cancelling query: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 61] Connection refused)")

If I try to issue other commands, it just keeps saying:

Reconnecting...
Creating new connection...
(2003, "Can't connect to MySQL server on 'localhost' ([Errno 61] Connection refused)")

Now for the odd part: if I restart mycli to the same server, the original long running query is still running. So the ^C never killed it and, somehow, it seems to have killed the ssh tunnel instead.

System

  • mycli version: 2.9.0
  • OS/version: macOS 26.6 (+homebrew)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions