I am running MySQL inside a docker container. When I try to connect to it using M-x sql-mysql I see the following error:

Unable to locate SQL program ‘mysql’

Yeah, I don't have mysql-client installed and would like to use it from a docker container. So I changed sql-mysql-program to be /usr/local/bin/docker exec -it fb34d517502c mysql, but again received an error:

Unable to locate SQL program ‘/usr/local/bin/docker exec -it fb34d517502c mysql’

Is there a way to use mysql-client from the docker container?

1 Answer 1


I solved this using an awesome docker-tramp.el. It offers TRAMP method docker to access running containers, so I can do:

C-x C-f /docker:container:/path/to/file

And then use sql-mode as usual

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.