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.
MySQL here document example
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment