1
0
mirror of git://f0xx.org/ac/ac-ms-template synced 2026-07-29 03:39:28 +03:00
This commit is contained in:
Anton Afanasyeu
2026-06-23 12:29:30 +02:00
commit 1ca30210bd
31 changed files with 1446 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/sh
# Grant existing androidcast app user access to url_shortener (after schema import as root).
# Password is NOT stored here — same as examples/crash_reporter/backend/config/config.php db.mysql.password
#
# Usage (on BE):
# mysql -u root -p < sql/schema.mariadb.sql
# ./scripts/init-mariadb-grants.sh
set -eu
DB_NAME="${URL_SHORTENER_DB_NAME:-url_shortener}"
DB_USER="${URL_SHORTENER_DB_USER:-androidcast}"
echo "Granting ${DB_USER}@localhost and @127.0.0.1 on ${DB_NAME}.* ..."
mysql -u root -p <<EOF
GRANT SELECT, INSERT, UPDATE, DELETE ON ${DB_NAME}.* TO '${DB_USER}'@'localhost';
GRANT SELECT, INSERT, UPDATE, DELETE ON ${DB_NAME}.* TO '${DB_USER}'@'127.0.0.1';
FLUSH PRIVILEGES;
EOF
echo "Smoke: mysql -u ${DB_USER} -p -h 127.0.0.1 ${DB_NAME} -e 'SHOW TABLES;'"