1
0

init_mysql_data.sh 363 B

123456789101112
  1. #!/bin/sh
  2. mysql_pod=$(kubectl get pods | grep mysql | awk '{print $1}')
  3. cd /tmp && \
  4. git clone --depth=1 https://github.com/open-falcon/falcon-plus && \
  5. cd /tmp/falcon-plus/ && \
  6. for x in `ls ./scripts/mysql/db_schema/*.sql`; do
  7. echo init mysql table $x ...;
  8. kubectl exec -it $mysql_pod -- mysql -uroot -p123456 < $x;
  9. done
  10. rm -rf /tmp/falcon-plus/