Page 1 of 2

MySQL Switch Issue

Posted: Thu Jan 17, 2013 11:11 pm
by radha
Hello,

I have followed throught the hsql to MySql instructions over and over. I am able to get it to connect successfully and also create some tables, but it still throws an error that blc_sku doesn't exist. I'm not sure what I am doing wrong. I dropped and recreated the schema many times and even gave my user dba privileges. However, the same error shows up:
[artifact:mvn] Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'myschemanamehere.blc_sku' doesn't exist

Can somebody please assist me? I don't know where to start the debug process because I am new to broadleaf. Any help is appreciated. Thank you for your assistance.


Sincerely,
Radha

Re: MySQL Switch Issue

Posted: Mon Jan 21, 2013 10:36 pm
by srinivas
Hi Radha,

Looks like some of the data not imported in other dependent tables(which blc_sku referring)

One option you have to compare each of the table against core/src/main/resources/sql/ (sql files) and import missing data then core/src/main/resources/runtime-properties/development-properties - update hbm2ddl.auto=update instead create-drop

Second option - I have used following configuration(Demositemaster downloaded and setup)
core version - <blc.version>2.1.1-GA</blc.version>
mysql - <version>5.1.22</version> (instead of 5.1.21)

Regards,
Srinivas

Re: MySQL Switch Issue

Posted: Tue Jan 22, 2013 3:11 am
by velmurugan
Hi All,

I am getting this error while switching to MySql database:

[artifact:mvn] [ERROR] 13:29:46 SchemaExport - Unsuccessful: create table BLC_CATEGORY (CATEGORY_ID bigint not null, ACTIVE_END_DATE timestamp, ACTIVE_START_DATE timestamp, ARCHIVED char(255), DESCRIPTION varchar(255), DISPLAY_TEMPLATE varchar(255), LONG_DESCRIPTION clob, NAME varchar(255) not null, URL varchar(255), URL_KEY varchar(255), DEFAULT_PARENT_CATEGORY_ID bigint, primary key (CATEGORY_ID))
[artifact:mvn] [ERROR] 13:29:46 SchemaExport - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'clob, NAME varchar(255) not null, URL varchar(255), URL_KEY varchar(255), DEFAUL' at line 1


Is there any problem related to MySql Version ?

Which version of Mysql is recommended ?

Please help !!!

Thanks in advance...
Vel.

Re: MySQL Switch Issue

Posted: Tue Jan 22, 2013 11:19 am
by phillipuniverse
Looks like you have the wrong Hibernate dialect still set. Check common-shared.properties in the core project, and specifically the blPU.hibernate.dialect (and blCMSStorage.hibernate.dialect and blSecurePU.hibernate.dialect). You can override this on a per-environment basis by using production.properties, staging.properties, etc.

The dialect you should be using is org.hibernate.dialect.MySQL5InnoDBDialect. We recommend using the latest GA release which is currently at 5.5.

Re: MySQL Switch Issue

Posted: Wed Jan 23, 2013 5:23 am
by velmurugan
Hi phillipuniverse,

Thanks for your quick reply.

I have updated the mysql dialect properly in the common-shared properties, but still i am getting this error.

Good news is that my colleague(Srinivas) was able to switch to mysql without any error. So i dumped his schema through MySql admin and updated "hbm2ddl.auto=update" .now both admin and site are working fine. :D :D :D

@Radha
I am attaching the dump file , you can also try to import the schema through mysql admin and update "hbm2ddl.auto=update"

Thanks,
Vel.

Re: MySQL Switch Issue

Posted: Wed Jan 23, 2013 10:30 am
by phillipuniverse
Just one more thing to add here; there might be other places where the Hibernate dialect is defined. common-shared.properties is the baseline properties file but this could be overridden by environment-specific properties files (for 'development', development-shared.properties and then develoment.properties). You could do a search for 'hibernate.dialect' to find all the occurrences of this.

Looks like you got your problem solved so that's good to hear! Just thought I would add this blurb in case someone else had a similar problem.

Re: MySQL Switch Issue

Posted: Wed Jan 23, 2013 2:56 pm
by csanchez
I just have the same problem, to solved it you have to install the core project (mvn install) after change the hibernate dialect in the common-shared.properties file.

Re: MySQL Switch Issue

Posted: Sun Feb 17, 2013 1:44 am
by sam
Hi All,
I am facing same problem like Radha, follow as instruction on getting started switch mysql section , please suggest us to rectify this issue
I am using mysql 5.5.29
*********************************

[artifact:mvn] [ERROR] 12:01:00 SchemaExport - Unsuccessful: create table BLC_CATEGORY (CATEGORY_ID bigint not null, ACTIVE_END_DATE timestamp, ACTIVE_START_DATE timestamp, ARCHIVED char(255), DESCRIPTION varchar(255), DISPLAY_TEMPLATE varchar(255), LONG_DESCRIPTION clob, NAME varchar(255) not null, URL varchar(255), URL_KEY varchar(255), DEFAULT_PARENT_CATEGORY_ID bigint, primary key (CATEGORY_ID))
[artifact:mvn] [ERROR] 12:01:00 SchemaExport - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'clob, NAME varchar(255) not null, URL varchar(255), URL_KEY varchar(255), DEFAUL' at line 1
[artifact:mvn] [ERROR] 12:01:01 SchemaExport - Unsuccessful: create table BLC_CONTENT (ID integer not null, ACTIVE_END_DATE timestamp, ACTIVE_START_DATE timestamp, APPROVED_BY varchar(255), APPROVED_DATE timestamp, BROWSER_TITLE varchar(255), CONTENT_DATE timestamp, CONTENT_TYPE varchar(255), DEPLOYED bit, DESCRIPTION clob, DISPLAY_RULE varchar(255), KEYWORDS varchar(255), LANGUAGE_CODE varchar(255), LAST_MODIFIED_BY varchar(255), LAST_MODIFIED_DATE timestamp, META_DESCRIPTION varchar(255), NOTE varchar(255), ONLINE_STATE bit, PARENT_CONTENT_ID integer, PRIORITY integer, REJECTED_BY varchar(255), REJECTED_DATE timestamp, RENDER_TEMPLATE varchar(255), SANDBOX varchar(255), SUBMITTED_BY varchar(255), SUBMITTED_DATE timestamp, TITLE varchar(255), URL_TITLE varchar(255), primary key (ID))
[artifact:mvn] [ERROR] 12:01:01 SchemaExport - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'clob, DISPLAY_RULE varchar(255), KEYWORDS varchar(255), LANGUAGE_CODE varchar(25' at line 1
***************************************************

Re: MySQL Switch Issue

Posted: Sun Feb 17, 2013 2:03 am
by sam
phillipuniverse wrote:Looks like you have the wrong Hibernate dialect still set. Check common-shared.properties in the core project, and specifically the blPU.hibernate.dialect (and blCMSStorage.hibernate.dialect and blSecurePU.hibernate.dialect). You can override this on a per-environment basis by using production.properties, staging.properties, etc.

The dialect you should be using is org.hibernate.dialect.MySQL5InnoDBDialect. We recommend using the latest GA release which is currently at 5.5.


Could you please provide url for MySQL 5.5 dialect ?

Re: MySQL Switch Issue

Posted: Sun Feb 17, 2013 9:53 am
by phillipuniverse
org.hibernate.dialect.MySQL5InnoDBDialect is the dialect you should be using.