• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    H2 to mySQL Error

    User help
    2
    4
    801
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      chrapchp
      last edited by

      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]

      1 Reply Last reply Reply Quote 0
      • MattFoxM
        MattFox
        last edited by

        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

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        1 Reply Last reply Reply Quote 0
        • C
          chrapchp
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • MattFoxM
            MattFox
            last edited by

            Fair enough, but looking at your error looks like you are trying to overwrite existing columns.

            Do not follow where the path may lead; go instead where there is no path.
            And leave a trail - Muriel Strode

            1 Reply Last reply Reply Quote 0
            • First post
              Last post