Menu

Using a Remote SQL Server

AJGrant

Using a Remote SQL Server

When installing and configuring Hypersocket it is possible to connect to an SQL server on another system in the event that you have installed the software on a system that has no SQL database and you do not wish to use the built in database. Make sure that the firewall on the SQL server system is set to accept incoming connections on the port that the SQL server uses and that the

GUI Installer

When you reach the database configuration during the Hypersocket installation process the data you enter will be almost the same as if the SQL server was on the same system as Hypersocket. Select the type of Database that the SQL server uses, then in the Host field provide the hostname or IP address of the system.


Configuration Edit

If you are using a command line installation then you will need to make this change after installation has completed, go to the Hypersocket conf directory

cd /opt/hypersocket/conf

Open the database.properties file in your text editior. Delete the current contents and then enter the template for the database type you are using on the remote server:

MySQL
jdbc.driver.className=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://${installer:databaseHost}:${installer:databasePort}/${installer:databaseName}?autoReconnectForPools=true&useUnicode=true&characterEncoding=UTF-8
jdbc.username=${installer:databaseUser}
jdbc.password=${installer:databasePassword}
jdbc.hibernate.dialect=org.hibernate.dialect.MySQLDialect


PostgreSQL
jdbc.driver.className=org.postgresql.Driver
jdbc.url=jdbc:postgresql://${installer:databaseHost}:${installer:databasePort}/${installer:databaseName}
jdbc.username=${installer:databaseUser}
jdbc.password=${installer:databasePassword}
jdbc.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect


Microsoft SQL Server
jdbc.driver.className=net.sourceforge.jtds.jdbc.Driver
jdbc.url=jdbc:jtds:sqlserver://${installer:databaseHost}:${installer:databasePort}/${installer:databaseName};ssl=request
jdbc.username=${installer:databaseUser}
jdbc.password=${installer:databasePassword}
jdbc.hibernate.dialect=org.hibernate.dialect.SQLServerDialect


Replace the 5 variables with the actual details of the server

${installer:databaseHost} - Hostname or IP address of the system the SQL Database is installed on
${installer:databasePort} - Port that the SQL Database operates on
${installer:databaseName} - Name of the database being used
${installer:databaseUser} - User that has access permissions for the database
${installer:databasePassword} - Password of the user

When the service starts, Hypersocket will check this file to see where it needs to target the database and then uses the details to authenticate the connection. If the connection is successfully made then the Hypersocket service starts.


Related

Wiki: Server Installation

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.