CONNECT_TO_MYSQL_AS_USER
1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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
[ -f ../docker-compose.yml ] && docker exec -it labinvent $0
[ -f ../docker-compose.yml ] && exit
# Execution SANS docker, ou bien AVEC docker depuis le conteneur
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_HOST
#echo $MYSQL_PORT #127.0.0.1:3307
#MYSQL_PORT=$(echo "$MYSQL_PORT" | cut -d':' -f 2)
#echo $MYSQL_PORT #3307
# PROD table : labinvent
mysql $MYSQL_DATABASE -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD
#mysql -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD
# TEST table : test_labinvent
#mysql test_$MYSQL_DATABASE -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD
#mysql test_labinvent -u labinvent_user -plabinvent --host='db'
#mysql labinvent -u labinvent_user -plabinvent --host='db'
#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