init_db.sh 410 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. set -e
  3. base_dir=$(
  4. cd "$(dirname "$0")"
  5. pwd
  6. )
  7. cd $base_dir
  8. # Check if MariaDB is running
  9. if systemctl is-active --quiet mariadb; then
  10. :
  11. else
  12. echo "❌ MariaDB is not running. Please start it first."
  13. exit 1
  14. fi
  15. # Configure MariaDB
  16. mysql -u root -e "CREATE DATABASE IF NOT EXISTS \`minio-into-stck-db\`;"
  17. # Done!
  18. echo "✅ Successfully configured MariaDB for minio-into-stck."