SourceForge Logo

XPlanner Installation - MySQL

Database Creation

Note: XPlanner requires the database character set to be in UTF8.

Using the MySQL command line client, create a database called "xplanner".

CREATE DATABASE xplanner CHARACTER SET UTF8 COLLATE utf8_general_ci; 

You can name your database anything you'd like as long as you modify or override the xplanner.properties correctly.

Create a user for XPlanner

$ mysql xplanner
           
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4999 to server version: 3.23.52-max-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> grant all on xplanner.* to 'xplanner'@'localhost' identified by '[password]'
Note:Sometimes the upgrade script will hang on trying to open a database connection (especially with c3p0). This is most likely due to the fact that your user does not have the permission to login as '[userid]@'[hostname]. To fix this, run the following:
grant all on xplanner.* to 'xplanner'@'[hostname]' identified by '[password]'
If you want also to access the database remotely run also
grant all on xplanner.* to 'xplanner'@'%' identified by '[password]';
Make sure you change [password] with a real password (in the installation procedure we use 'xp').
Again be sure to override the database properties in xplanner-custom.properties with your user and password. See the MySQL grant syntax for more information.

Packet Size Configuration for Attachments

XPlanner allows up to 1Gb attachments. You need to setup Mysql for that size attachments following the packet size configuration instructions.
Edit your option file and add the lines:

[mysqld]
max_allowed_packet=1024M

Mysql Tips

Mysql option file location

Mysql stores its configuration options in a file as followed:

Windows

Mysql versionFile location
prior to 4.1.5c:\Windows\my.ini or c:\my.cnf
4.1.5 and afterMYSQL_INSTALL_DIR/my.ini

Unix

Mysql versionFile location
prior to 5.0.5/etc/my.cnf or $DATADIR/my.cnf
5.0.6 and after/etc/my.cnf or $MYSQL_HOME/my.cnf

The --defaults-file option instructs the MySQL server to read the specified file for configuration options when it starts.

References: Windows location, Options file locations

UTF8 charset

Set mysql default character set to UTF8

To configure MySQL to use UTF-8 encoding by default, edit your option file and add the lines:

[mysqld]
default-character-set=utf8

You can then create dataase in this simpler way

CREATE DATABASE xplanner
Changing the tables of an already created database to UTF8
Alter the tables to use UTF-8 encoding:
ALTER TABLE xxx CHARACTER SET utf8;
ALTER TABLE xxx COLLATE utf8;