Menu

MySQL Database on Linux

AJGrant

External MySQL Database on Linux

If you wish to use a MySQL server installed locally rather than using the default Built-In database then you should install and configure the MySQL database prior to installing and Configuring Hypersocket. If you are using Ubuntu then bear in mind that as of Ubuntu 12.4 MySQL is installed by default, if it is not installed use the following command:

sudo apt-get install mysql-server

MySQL server should be running run the following command from a terminal prompt to check:

sudo netstat -tap | grep mysql

You should see the following line or something similar:

tcp 0 0 localhost:mysql *:* LISTEN 2556/mysqld

If the server is not running start it:

sudo service mysql restart

After installation, connect to your MySQL server as root from a terminal prompt and execute the following:

$ create database hypersocket;
$ grant all privileges on hypersocket.* to hypersocket@localhost identified by 'hypersocket';
$ flush privileges;

Now install Hypersocket.

Depending on the installer you are using, configuring Hypersocket to use the MySQL database will differ. If you are using a GUI installer then after the Hypersocket files are installed you will be prompted to configure Hypersocket's operational ports and then the database to be used, here you will be able to select the MySQL option and then provide the hostname and port of the server, the database name, and authentication details, if you followed the earlier example these would be:

Hostname – localhost
Port – 3306
Database – hypersocket
Username – hypersocket
Password - hypersocket

Finishing this configuration will complete the installation and you will be able to start the Hypersocket service.

If you are using a command line installer then configuration requires a little bit more. After installation completes and before the service is started you will need to go to the Hypersocket conf directory:

cd /opt/hypersocket/conf

Open the database.properties file as root in order to edit the content:

sudo vi database.properties

Delete the existing contents of the file and enter the following replacing the 5 variable entries with the relevant details for the MySQL server,

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.hiberate.dialect=org.hibernate.dialect.MySQLDialect

The file will contain a number of placeholder values that need to be updated, each of these entries will need to be changed to use the actual details of the SQL database that Hypersocket will connect to:
If you used the earlier example then the text should now look like this:

jdbc.driver.className=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/hypersocket?autoReconnectForPools=true&useUnicode=true&characterEncoding=UTF-8
jdbc.username=hypersocket
jdbc.password=hypersocket
jdbc.hiberate.dialect=org.hibernate.dialect.MySQLDialect

Save the changes to the file and start the service, Hypersocket should now begin using the MySQL database.


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.