1

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?

Oles Savluk
  • 196
  • 3
  • 10

1 Answers1

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

Oles Savluk
  • 196
  • 3
  • 10