Blame view

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

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




d84529c1   Etienne Pallier   ajout scripts con...
13

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

7aa0dc74   Etienne Pallier   bugfix pour exec ...
17
18
19
echo $MYSQL_USER
echo $MYSQL_PASSWORD
echo $MYSQL_HOST
d84529c1   Etienne Pallier   ajout scripts con...
20
21
22
23
24

#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 ...
25
# PROD table : labinvent
c4bc1ff0   Etienne Pallier   amelioration scri...
26
mysql $MYSQL_DATABASE -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD
7aa0dc74   Etienne Pallier   bugfix pour exec ...
27
28

# TEST table : test_labinvent
4365cfbd   Etienne Pallier   amelioration scri...
29
#mysql test_${MYSQL_DATABASE} -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD
7aa0dc74   Etienne Pallier   bugfix pour exec ...
30
31
32

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