H2 enabling remote database creation first

https://w‮w‬w.lautturi.com
H2 enabling remote database creation first

To enable remote database creation in H2, you need to start the H2 server and configure it to allow remote connections.

Here's an example of how you can do this:

  1. Download and install H2 from the H2 website (https://www.h2database.com/html/download.html).
  2. Open a terminal window and navigate to the directory where H2 is installed.
  3. Start the H2 server by running the following command:
./h2.sh
  1. In a web browser, go to the H2 Console (http://localhost:8082) and log in using the default username and password (sa and an empty password).
  2. In the H2 Console, click the "Change Settings" button in the top right corner.
  3. In the "Settings" dialog, go to the "Web Settings" tab and check the "Allow other computers to connect" option.
  4. Click the "Save" button to save the changes.

Now the H2 server will allow remote connections and you should be able to create databases remotely using the H2 Console or a JDBC client.

Note that by default, the H2 server listens on port 8082 and only allows connections from localhost. You can change these settings by specifying the -webPort and -webAllowOthers options when starting the server. For example:

./h2.sh -webPort 8888 -webAllowOthers

This will start the H2 server on port 8888 and allow connections from any host.

Created Time:2017-11-01 12:04:58  Author:lautturi