CONNECT_TO_MYSQL_AS_USER 833 Bytes
#!/usr/bin/env bash

# Si execution directe depuis le repertoire data/ (bind du repertoire docker)
# => on rappelle ce meme script avec le CLI docker puis on exit
if [[ -f ../DOCKER_LABINVENT_START ]] ; then
    #cd ../
    docker exec -it labinvent $0
    exit
fi
echo "IN $(pwd)"


# Si fichier install/ENV.sh existe, alors mode SANS docker
[ -f install/ENV.sh ] && source install/ENV.sh

#echo $MYSQL_USER
#echo $MYSQL_PASSWORD

#echo $MYSQL_PORT #127.0.0.1:3307
#MYSQL_PORT=$(echo "$MYSQL_PORT" | cut -d':' -f 2)
#echo $MYSQL_PORT #3307

mysql $MYSQL_DATABASE -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD
#mysql $MYSQL_DATABASE -h 127.0.0.1 -u $MYSQL_USER -p$MYSQL_PASSWORD
#mysql -h 127.0.0.1 -u $MYSQL_USER -P $MYSQL_PORT --protocol=tcp -p$MYSQL_PASSWORD
#mysql -h 127.0.0.1 -u $MYSQL_USER -P $MYSQL_PORT -p$MYSQL_PASSWORD