简体   繁体   中英

Setting up and saving connection profile in SQL Workbench/j from command line/batch

Using the guide https://www.sql-workbench.eu/manual/commandline.html#commandline-connect-noprofile
to set up as profile and save the profile for future use.
This is possible manually via "7.2. Managing profile groups" https://www.sql-workbench.eu/manual/profiles.html#profile-workbench-settings

Is it possible to save a profile via the command line?

SQLWorkbench64.exe -username=user -password=pass -url=jdbc.. -driver=Redshift driverJar=filepath

There is no direct support for this.

But you can use the WbStoreProfile command to store the currently active connection as a profile.

You can do this through the -command parameter.

SQLWorkbench64.exe  -command="WbStoreProfile -name=test" -username=user -password=pass -url=jdbc.. -driver=Redshift driverJar=filepath

That will connect to the database, then run the WbStoreProfile command and exit again.

The profile will be saved under the name "test" in wb-profiles.properties .

But it's probably easier to edit wb-profiles.properties manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM