Reason: Most probably, the reason is because the H2 Database Console default port number 8082, is already being used by some other process running on the user system.


Solution 1:

If the process which is using the port = 8082 is a temporary process then, kill the process and run the h2console command on the CMD or Terminal Window.


Solution 2:

You can change the default port of H2 Console by setting the value of webPort property value to custom port number e.g. (webPort = 8092) using the H2 server properties file: .h2.server.properties

You can find the .h2.server.properties in the User's home directory.

For example, let's assume the User's Home Directory path -

On Windows:
User's Home Directory is: C:\Users\admin

On Linux:
User's Home Directory is: /home/admin

Kindly, look for the file named: .h2.server.properties in the User's home directory location.

  1. Open the file and change the property value of webPort from 8082 (Default Port) to any user available port e.g. (webPort = 8092)
  2. Save the file and run the h2console command again.

Notes:

1. If in case, you didn't have a file in your User's Home Directory then, kindly create a file with a name: .h2.server.properties and put the content provided below in the file and save it.

#H2 Server Properties
#Wed Sep 25 19:16:36 IST 2019
0=|org.h2.Driver|jdbc\:h2\:file\:~/lms_course/lms_alpha;AUTO_SERVER\=TRUE|sa
1=Generic H2 (Embedded)|org.h2.Driver|jdbc\:h2\:file\:~/lms_course/lms_alpha;AUTO_SERVER\=TRUE|sa
webAllowOthers=false
webPort=8092
webSSL=false

After saving the file, please run the h2console command on the CMD or Terminal Window.


2. We have also attached a .h2.server.properties file for you which you can download and place it in your User's Home Directory to move forward.