Download init-db.sh from stat-utas/test: direct link, hf CLI and curl.
- Browser
- Download file 451 Bytes
-
https://huggingface.co/spaces/stat-utas/test/resolve/main/init-db.sh
- Command line
-
hf download hf://spaces/stat-utas/test/init-db.sh
-
curl -L -o init-db.sh https://huggingface.co/spaces/stat-utas/test/resolve/main/init-db.sh
451 Bytes
| set -e | |
| # Initialize the database | |
| mysqld --initialize-insecure --user=mysql | |
| # Start MariaDB in the background | |
| mysqld_safe & | |
| sleep 10 | |
| # Create the database and user | |
| mysql -e "CREATE DATABASE IF NOT EXISTS moodle;" | |
| mysql -e "CREATE USER IF NOT EXISTS 'moodleuser'@'%' IDENTIFIED BY 'moodlepassword';" | |
| mysql -e "GRANT ALL PRIVILEGES ON moodle.* TO 'moodleuser'@'%';" | |
| mysql -e "FLUSH PRIVILEGES;" | |
| # Shut down the server | |
| mysqladmin shutdown | |