DB/Table definitions needed for client variables via MySQL

Hello. I am needing to setup a client variable datasource using MySQL.

Is there a certain way the MySQL database needs to be configured for lucee
(i.e. table definitions etc) or will it simply work after setting it up in
the admin interface?

Thanks!

HI Josh, this should work fine. I just recently set it up myself. Here is a
a sample Application.cfc that will configure client (and session) database
storage so that your application is portable.

component {

this.datasources[“lucee_sessions”] = {
class: ‘org.gjt.mm.mysql.Driver’
, connectionString:
‘jdbc:mysql://192.168.33.10:3306/lucee_sessions?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true’
, username: ‘lucee_sessions’
, password: “your_password”
// optional settings
, storage:true // default: false
};

this.sessionTimeout = createTimeSpan(0,0,20,0); //Set a default session
timeout of 20 minutes
this.sessionStorage = “lucee_sessions”; //Set our session storage to the
lucee_sessions datasource

this.clientTimeout = createTimeSpan(0,1,0,0);
this.clientManagement = true;
this.clientStorage = “lucee_sessions”;
this.clientCluster = true; //Set true if more than one Lucee instance
connected to the same client store

function onSessionStart(){
session.someData = “My Data”;
}

function onRequestStart(){
client.myData = “My Client Data”;
}
}On Wednesday, April 13, 2016 at 5:43:03 PM UTC-4, Josh Beach wrote:

Hello. I am needing to setup a client variable datasource using MySQL.

Is there a certain way the MySQL database needs to be configured for lucee
(i.e. table definitions etc) or will it simply work after setting it up in
the admin interface?

Thanks!

Thank you that definitely helps!

Can you tell me in what situations it is best to use a database for session
storage instead of memory?On Thursday, April 14, 2016 at 6:31:43 AM UTC-5, Rory Laitila wrote:

HI Josh, this should work fine. I just recently set it up myself. Here is
a a sample Application.cfc that will configure client (and session)
database storage so that your application is portable.

component {

this.datasources[“lucee_sessions”] = {
class: ‘org.gjt.mm.mysql.Driver’
, connectionString: 'jdbc:mysql://
192.168.33.10:3306/lucee_sessions?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true

, username: ‘lucee_sessions’
, password: “your_password”
// optional settings
, storage:true // default: false
};

this.sessionTimeout = createTimeSpan(0,0,20,0); //Set a default session
timeout of 20 minutes
this.sessionStorage = “lucee_sessions”; //Set our session storage to the
lucee_sessions datasource

this.clientTimeout = createTimeSpan(0,1,0,0);
this.clientManagement = true;
this.clientStorage = “lucee_sessions”;
this.clientCluster = true; //Set true if more than one Lucee instance
connected to the same client store

function onSessionStart(){
session.someData = “My Data”;
}

function onRequestStart(){
client.myData = “My Client Data”;
}
}

On Wednesday, April 13, 2016 at 5:43:03 PM UTC-4, Josh Beach wrote:

Hello. I am needing to setup a client variable datasource using MySQL.

Is there a certain way the MySQL database needs to be configured for
lucee (i.e. table definitions etc) or will it simply work after setting it
up in the admin interface?

Thanks!