Closed ChristianAdamski closed 4 years ago
Short answer: that's not how it works.
Running mysql
inside cli (fin bash
) without any options won't connect you to the mysql server in the db container.
Do it like this instead:
docker@cli:/var/www$ mysql -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE}
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 31
Server version: 8.0.20 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [default]>
or using drush:
$ fin bash
docker@cli:/var/www$ cd docroot/
docker@cli:/var/www/docroot$ drush sql:cli
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 95
Server version: 8.0.20 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [default]>
or using fin db cli
from the host machine:
$ fin db cli
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.20 MySQL Community Server - GPL
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
cap@ecomm-1003-vm: /Dev/drupal8$ fin restart Disconnecting project network... Stopping services... Stopping drupal8_web_1 ... done Stopping drupal8_cli_1 ... done Stopping drupal8_chrome_1 ... done Stopping drupal8_solr_1 ... done Stopping drupal8_db_1 ... done Stopping drupal8_pma_1 ... done Starting services... Creating network "drupal8_default" with the default driver Pulling db (docksal/mysql:8.0-edge)... 8.0-edge: Pulling from docksal/mysql 54fec2fa59d0: Pull complete [..] d2fb21ed3a96: Pull complete Digest: sha256:191b916a2383c3c7d159213132f224cbf6bf122c78d03e9963632ddd5d1b124d Status: Downloaded newer image for docksal/mysql:8.0-edge Starting drupal8_chrome_1 ... done Starting drupal8_pma_1 ... done Recreating drupal8_db_1 ... done Starting drupal8_solr_1 ... done Starting drupal8_cli_1 ... done Starting drupal8_web_1 ... done Connected vhost-proxy to "drupal8_default" network. Waiting for project stack to become ready... [..] Waiting for project stack to become ready... cap@ecomm-1003-vm: /Dev/drupal8$ fin bash docker@cli:/var/www$ mysql ERROR 1045 (28000): Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/mariadb19/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory docker@cli:/var/www$