github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/polardbx/scripts/xstore-setup.tpl (about)

     1  #!/bin/sh
     2  # usage: xstore-setup.sh
     3  # setup root account for xstore and run entrypoint
     4  
     5  function setup_account() {
     6      until myc -e 'select 1'; do
     7          sleep 1;
     8          echo "wait mysql ready"
     9      done
    10      echo "mysql is ok"
    11      myc -e "SET sql_log_bin=OFF;SET force_revise=ON;CREATE USER IF NOT EXISTS $KB_SERVICE_USER IDENTIFIED BY '$KB_SERVICE_PASSWORD';GRANT ALL PRIVILEGES ON *.* TO $KB_SERVICE_USER;ALTER USER $KB_SERVICE_USER IDENTIFIED BY '$KB_SERVICE_PASSWORD';"
    12  
    13  }
    14  
    15  
    16  setup_account &
    17  /tools/xstore/current/venv/bin/python3 /tools/xstore/current/entrypoint.py