Database
David avatar
Written by David
Updated over a week ago

You can provide access to MySQL, Postgres, Neo4j, or Mongo database to student by turning the database flag in the Workspace tab of the part configuration.

If you want to initialize the database, create an SQL file and store it as resource/asnlib/public/init.sql in the teacher view:

The file must be called init.sql

PLEASE MAKE SURE INIT.SQL HAS NO ERRORS - THIS WILL PREVENT THE DATABASE FROM LAUNCHING. You can access the database in student view to develop init.sql.

To get the credentials to initialize the database, go to "Student View" from your "Configure Worskpace" page. Select Start Labs to start the database.

Please wait till the database is Ready. This may take a few seconds (will timeout at 2 minutes in case of error).Then select "Details" tab and there should be a "Database" entry -

If you select "Show" you will be provided credentials for database -

Finally to access the DB using GUI tools use Actions -> Applications and select MySQL Workbench or pgAdmin:

More details on how to use the database GUI tools are available on the help section.

Did this answer your question?