Add mycli to Lando

mycli is a better sql terminal client. https://www.mycli.net. It has autocomplete and can save queries among, other things.

To install it in Lando, add this to your .lando.yml file:

services:
  appserver:
    build_as_root:
      - apt update && apt install -y vim
      - apt update && apt install -y mycli
    overrides:
      environment:
        LC_ALL: C.UTF-8
        LANG: C.UTF-8
tooling:
  mycli:
    service: appserver
    description: Open mycli client
    cmd: mycli -udrupal8 -pdrupal8 -hdatabase drupal8

As a bonus we're installing vim so we can edit sql commands with it.

The database connection is hardcoded in cmd, if you need to change it.

Run lando rebuild -y to install and then use lando mycli from your host to connect.

Tags
Lando