Blame view

CONNECT_TO_MYSQL_AS_USER 1.3 KB
d84529c1   Etienne Pallier   ajout scripts con...
1
2
#!/usr/bin/env bash

2f2cd340   Etienne Pallier   amelioration test...
3
# Si docker et execution directe (hors conteneur) depuis le repertoire data/ (bind du repertoire docker)
c4bc1ff0   Etienne Pallier   amelioration scri...
4
# => on rappelle ce meme script avec le CLI docker puis on exit
2f2cd340   Etienne Pallier   amelioration test...
5
6
7
[ -f ../docker-compose.yml ] && (docker exec -it labinvent $0 $* ; true) && exit
#[ -f ../docker-compose.yml ] && docker exec -it labinvent $0
#[ -f ../docker-compose.yml ] && exit
4365cfbd   Etienne Pallier   amelioration scri...
8
# Execution SANS docker, ou bien AVEC docker depuis le conteneur
7aa0dc74   Etienne Pallier   bugfix pour exec ...
9
echo "IN $(pwd)"
4365cfbd   Etienne Pallier   amelioration scri...
10
11
12
13




d84529c1   Etienne Pallier   ajout scripts con...
14

c4bc1ff0   Etienne Pallier   amelioration scri...
15
16
17
# Si fichier install/ENV.sh existe, alors mode SANS docker
[ -f install/ENV.sh ] && source install/ENV.sh

2f2cd340   Etienne Pallier   amelioration test...
18
19
20
#echo $MYSQL_USER
#echo $MYSQL_PASSWORD
#echo $MYSQL_HOST
d84529c1   Etienne Pallier   ajout scripts con...
21
22
23
24
25

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

7aa0dc74   Etienne Pallier   bugfix pour exec ...
26
# PROD table : labinvent
c4bc1ff0   Etienne Pallier   amelioration scri...
27
mysql $MYSQL_DATABASE -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD
f4953d67   Etienne Pallier   modif variables e...
28
#mysql -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD
7aa0dc74   Etienne Pallier   bugfix pour exec ...
29
30

# TEST table : test_labinvent
f4953d67   Etienne Pallier   modif variables e...
31
#mysql test_$MYSQL_DATABASE -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD
7aa0dc74   Etienne Pallier   bugfix pour exec ...
32
33
34

#mysql test_labinvent -u labinvent_user -plabinvent --host='db'
#mysql labinvent -u labinvent_user -plabinvent --host='db'
c4bc1ff0   Etienne Pallier   amelioration scri...
35
#mysql $MYSQL_DATABASE -h 127.0.0.1 -u $MYSQL_USER -p$MYSQL_PASSWORD
d84529c1   Etienne Pallier   ajout scripts con...
36
37
#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