SUPPORT  :  NEBULAE MULTIUSER SERVER TECHNOTES :  NS005
 

Connecting Nebulae to a MySQL Database

 

This technote assumes that the MySQL database engine is installed correctly and running, and that the user can connect to the msqld process. It is also assumed that a MySQL database has already been initialized. To test if you can connect to the database locally we recommend using the mysql tool, included with MySQL. The setup of MySQL databases and permissions can be tricky, and Tabuleiro support is not able to help you with questions related to MySQL installation. Please make sure you can access the MySQL database locally using the mysql tool before attempting to configure the Nebulae connection.

Nebulae needs a JDBC driver to connect to the MySQL database. One of the most used JDBC drivers for MySQL can be available from http://mmmysql.sourceforge.net . Please read the documentation, download and extract the driver, and make sure the mysql_uncomp.jar file is available in a directory listed in the classpath when the Nebulae server starts. For example if you have copied the mysql_uncomp.jar file containing the driver to the /usr/local/nebulae directory you can use the following shell script to startup Nebulae (in Linux):


#!/bin/csh -f

cd /usr/local/nebulae

unlimit

/usr/local/j2sdk1.3.1/bin/java -green -Djava.compiler=NONE -cp Nebulae.jar:/usr/local/nebulae:mysql_uncomp.jar net.tabuleiro.nebulae.Nebulae &


In the Nebulae.cfg file you need to find and edit the SQL related directives to the following values:


EnableSQLDatabase = 1

SQLBackend = mysql

SQLDatabaseDriver = org.gjt.mm.mysql.Driver

SQLDatabaseURL = jdbc:mysql:YourDatabaseNameHere

SQLDatabaseUsername = mysqlusernamehere

SQLDatabasePassword = mysqluserpasswordhere


Notice that the SQLDatabaseURL directive contains the name of the JDBC database. In this case we are connecting to a JDBC URL that points to a database in the same machine, but nothing prevents us from connecting to databases on a remote host (using an URL like jdbc:mysql://www.otherhost.com/MyDB ). Some versions of the mmMySQL drivers running on Linux require a different syntax for local connections, where the localhost needs to be specified explicitally (jdbc:mysql://localhost/MyDB) . Please consult mmMySQL JDBC documentation for more information about JDBC URL syntax.

The SQLDatabaseUsername and SQLDatabasePassword directives should contain the name and password for an user that has user access to the database, as defined by MySQL rules. Please consult the Nebulae server log for any error messages that may occur during the initialization of the SQL connection.

 

 ID: PRODUCT: PLATFORM: VERSION: KEYWORDS: LAST UPDATED: AREA:
 NS005 Nebulae MultiUser Server All 1.2 MYSQL, Nebulae October 13, 2003 Nebulae