docker conectar a mysql de otro contenedor
snippet in sql

docker conectar a mysql de otro contenedor

user4431

$ docker exec -it mysql-db mysql -p
...
mysql> create database demo;         
Query OK, 1 row affected (0.32 sec)  
                                    
mysql> show databases;               
+--------------------+               
| Database           |               
+--------------------+               
| demo               |               
| information_schema |               
| mysql              |               
| performance_schema |               
| sys                |               
+--------------------+               
5 rows in set (0.00 sec)             
                                    
mysql>