Skip to content

Instantly share code, notes, and snippets.

@pietrorea
Created January 28, 2022 16:47
Show Gist options
  • Save pietrorea/9081e2810c20337c6ea85350a31bb427 to your computer and use it in GitHub Desktop.
Save pietrorea/9081e2810c20337c6ea85350a31bb427 to your computer and use it in GitHub Desktop.

Revisions

  1. pietrorea created this gist Jan 28, 2022.
    5 changes: 5 additions & 0 deletions mysql-here-document.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    mysql -u root --password="${PASSWORD}" <<EOF
    CREATE DATABASE ${DB_NAME};
    CREATE USER '${APP_USER}'@'localhost' IDENTIFIED BY '${APP_PASSWORD}';
    GRANT ALL ON ${DB_NAME}.* TO '${APP_USER}'@'localhost'
    EOF