I am pretty new to this. I am trying to set up a local Java environment, and my attempts at connecting my database via JDBC have failed so I am also trying to create a local version of the database using existing .sql files and an .sh file:
mazefire-recreate-db.sh:
cd src/main/sql
# DROP tables
mysql --user=**** --password=**** mazefirehg < mazefire-db-schema-DROP-mysql.sql
# Recreate tables (existing and new)
mysql --user=**** --password=**** mazefirehg < mazefire-db-schema-mysql.sql
mysql --user=**** --password=**** mazefirehg < mazefire-db-schema-new-tables.sql
# Reference/existing/new data import
mysql --user=**** --password=**** mazefirehg < mazefire-db-existing-data.sql
mysql --user=**** --password=**** mazefirehg < mazefire-db-data-new-tables.sql
# ALTER scripts
mysql --user=**** --password=**** mazefirehg < dbupdate-001-alter-answers.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-002-alter-users.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-003-alter-played.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-004-alter-mazes.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-006-new-table-subscription.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-007-alter-mazes-images.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-008-alter-questions-issue-61.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-009-alter-mazes-images.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-010-alter-played-gotRightTwice.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-011-alter-mazes-images.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-012-alter-mazes-images-biology101.3.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-013-alter-played-large-fields.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-014-alter-mazes-images-biology101.4.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-015-alter-mazes-categories.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-016-update-pages.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-017-alter-played-invalid-entry.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-018-update-pages.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-019-create-userconnection.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-020-alter-user.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-021-alter-mazes-categories-MEDscience.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-022-update-pages.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-023-new-table-maze_collection-and-collection_maze.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-024-alter-mazes-categories.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-025-alter-questions-special-characters.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-026-alter-collections.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-027-alter-in_collection.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-029-alter-collection.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-030-new-table-player_collection.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-031-alter-player_collection.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-032-alter-played.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-033-update-mazes-thumbnails.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-034-update-mazes-thumbnails-may13-2015.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-035-alter-answers-special-characters.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-036-alter-questions-explain-special-characters.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-037-alter-mazes-isStretched.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-038-update-mazes-thumbnails-may30-2015.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-040-update-users-data.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-039-update-latest-data-jun11-2015.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-042-alter-mazes-thumbImages-size.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-041-update-mazes-thumbnails-June13-2015.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-043-alter-mazes-isPack.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-044-update-mazes-isPack.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-045-update-mazes-thumbnails-June17-2015.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-046-create-trigger-for-old-new-site-integration.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-047-update-mazes-thumbnails-June24-2015.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-048-insert-and-update-mazes.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-049-insert-anatomy-and-physiology-2.10-maze-data.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-050-missing-AnP-mazes-from-pak.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-051_alter_maze_collections.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-052_remove_unused_collection_tables.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-053-update-Pages.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-054-collections-cleanup.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-055-create-user-purchased-mazes.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-056-update-maze-thumbnails-Biochem-Microbiology.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-057-create-pharmacology-collection.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-058-microbiology-collection-and-other-cleanup.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-059-collections-category-cleanup-new-biochem-collection.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-060-update-Pages.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-061-microbiology-collection-updates-copy.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-062-create_user_purchased-collections.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-063-update-maze-thumbnails-microbiology_astrobiology.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-064-update-microbiology-collection-categories-fix-for-healthcare.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-065-update-collections-verbiage.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-066-maze-thumnail-image-for-Anp2.9.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-067-change-collection-description-size.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-068-alter-played.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-069-alter-played-increase-size-of-pathtaken-and-gotwrong.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-070-alter-table-played.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-071-alter-table-answers.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-072-alter-table-played.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-073-new-table-testimonial.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-074-update-table-testimonial.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-075-alter-table-played.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-076-alter-table-played.sql
# Updates from here for teacher dashboard
mysql --user=**** --password=**** mazefirehg < dbupdate-077-alter-table-users-teachers.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-078-alter-admin-users.sql
mysql --user=**** --password=**** mazefirehg < dbupdate-079-revert-admin-column.sql
cd ../../../
Each of the sql files referenced are doing some combination of creating tables, importing data, etc. I am using IntelliJ and found I can Before Launch "Run External Tool" via the Run/Debug Configurations. You can see my Run/Debug Configurations as well as my External Tool Configurations.
I am unsure if I should be referencing other files/directories:
Program: the path to where the mazefire-recreate-db.sh file resides.
Also tried referencing "mazefire.recreate-db.bat" file.
Parameters: the actual .sh file.
Working directory: the path to where all the .sql files that create/modify/import/etc. the database reside.
The error I get for now is:
Error running 'database': Cannot run program "/Users/jayjapra/IdeaProjects/MazePilot" (in directory "/Users/jayjapra/IdeaProjects/MazePilot/src/main/sql"): error=13, Permission denied
even though I used chmod to add execute permissions so I don't believe I am referencing correctly.