MySQL Support

MySQL support is available as of version 0.14.

There are two entries in config.yml that are of interest for MySQL support. These are dataStoreMethod and dataStoreSettings.

Note that only home locations are stored in the MySQL database. Warmups, cooldowns and invites currently are not. This may change in a future version, if requested.

dataStoreMethod

The "dataStoreMethod" settings is used to determine which data store method to use when loading and saving home locations. Currently, the dataStoreMethod setting has two possible values:

  • file: Home locations are stored in a flat text file in the plugin data directory.
  • sql: Home locations are stored in a SQL database. Currently, only "jdbc:mysql" databases are supported and tested. Other database types *may* work, but are not tested or recommended.

dataStoreSettings

This setting stores the various settings for all the available data store methods. Each datastore method has a child settings node under this node.

file

This node stores settings for the flat file storage method. It supports only one sub-node:

filename: This specifies the filename to store the home locations in. Default is "homes.txt".

sql

This node stores settings for the SQL storage method. It contains the following nodes:

url: This is the URL to the database instance and data store. Default value is "jdbc:mysql://localhost/MultiHome" user: This is the username to use when loggin in to the SQL database. pass: This is the password used with the username to access the database.

Table DDL

Use the following DDL command to create the required "homes" table.

CREATE TABLE `homes` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`owner` varchar(50) NOT NULL,
	`home` varchar(50) NOT NULL,
	`world` varchar(50) NOT NULL,
	`x` double NOT NULL,
	`y` double NOT NULL,
	`z` double NOT NULL,
	`pitch` float NOT NULL,
	`yaw` float NOT NULL,
	PRIMARY KEY (`id`)
)

Comments

Posts Quoted:
Reply
Clear All Quotes