H2 to mySQL Error
-
I thought this should be a straightforward process. I installed Mango 3.77 on a headless ubuntu server 20.04 and mysql 8+. Moved the mango files and config to new env and worked fine under H2. Then configured env.properties to include mySQL and convert.
I get this error. Duplicate column? Any ideas?
INFO 2021-03-01T09:21:02,784 (com.serotonin.m2m2.Lifecycle.loadLic:670) - License file not found
INFO 2021-03-01T09:21:02,870 (com.serotonin.m2m2.db.BasePooledProxy.initializeImpl:36) - Initializing pooled connection
manager
WARN 2021-03-01T09:21:05,381 (com.serotonin.m2m2.db.upgrade.DBUpgrade.checkUpgrade:98) - Upgrading 'core' from 1 to 2
INFO 2021-03-01T09:21:05,383 (com.serotonin.m2m2.db.upgrade.DBUpgrade.createUpdateLogOutputStream:169) - Writing upgrad
e log to /opt/mango/logs/com.serotonin.m2m2.db.upgrade.Upgrade1.log
FATAL 2021-03-01T09:21:05,578 (com.serotonin.m2m2.db.AbstractDatabaseProxy.initialize:185) - Exception initializing data
base proxy: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [alter table publishers
add column rtdata longblob; ]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate
column name 'rtdata'
com.serotonin.ShouldNeverHappenException: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL gr
ammar [alter table publishers add column rtdata longblob; ]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSy
ntaxErrorException: Duplicate column name 'rtdata'
at com.serotonin.m2m2.db.upgrade.DBUpgrade.checkUpgrade(DBUpgrade.java:104) ~[mango-3.7.7.jar:?]
at com.serotonin.m2m2.db.upgrade.DBUpgrade.checkUpgrade(DBUpgrade.java:36) ~[mango-3.7.7.jar:?]
at com.serotonin.m2m2.db.AbstractDatabaseProxy.initialize(AbstractDatabaseProxy.java:171) ~[mango-3.7.7.jar:?]
at com.serotonin.m2m2.Lifecycle.databaseInitialize(Lifecycle.java:732) ~[ma-priv-3.7.7.jar:?]
at com.serotonin.m2m2.Lifecycle.initialize(Lifecycle.java:285) ~[ma-priv-3.7.7.jar:?]
at com.serotonin.m2m2.Main.main(Main.java:159) ~[ma-priv-3.7.7.jar:?]
Caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [alter table publishers a
dd column rtdata longblob; ]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate c
olumn name 'rtdata'
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.ja
va:93) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE] -
Stick to 5.7.x
Mysql 8 has made a boatload of changes that a lot of systems haven't got full compatibility of.Fox
-
The reason I jump on mySQL 8 is because someone said it worked. I'll try an older version.
https://forum.mango-os.com/topic/4686/mysql-version/6?_=1614639710932
-
Fair enough, but looking at your error looks like you are trying to overwrite existing columns.