Ad Widget

Collapse

Upgrading MySQL-Database 1.4.5 > 1.6 exit with error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rrr
    Senior Member
    • Sep 2007
    • 100

    #1

    Upgrading MySQL-Database 1.4.5 > 1.6 exit with error

    When I upgraded the MySQL-Database via the patch.sql shema it exits with error:
    Code:
     
    ERROR 1061 (42000) at line 144: Duplicate key name 'httptest_httptest_1'
    It's because the key 'httptest_httptest_1' still exists, but for a other field!
    Since this existing index isn't needed in the 1.6-Version (see createshema for v1.6) it can be deleted.
  • BlouPhil
    Junior Member
    • Nov 2007
    • 12

    #2
    Got same problem over here...

    Do you know what table I need to edit in order to delete it?

    Thanks

    Comment

    • xs-
      Senior Member
      Zabbix Certified Specialist
      • Dec 2007
      • 393

      #3
      are you upgrading from 1.5.x or 1.4.x?

      Comment

      • BlouPhil
        Junior Member
        • Nov 2007
        • 12

        #4
        From 1.4.5

        Comment

        • xs-
          Senior Member
          Zabbix Certified Specialist
          • Dec 2007
          • 393

          #5
          First off, i hope you made database dumps!

          Well, i'd do the following:
          - open patch.sql
          - search for the line containing: httptest_httptest_1 and look which table it tries to set it

          Now either do
          - enter the zabbix database
          - remove the index httptest_httptest_1 from the tablename you just looked up
          - process the remainder of the patch.sql script

          or
          - Restore backup
          - enter zabbix database
          - remove index httptest_httptest_1 from tablename you just looked up
          - Apply patch.sql





          (repeat when other errors occur)

          Comment

          • Alexei
            Founder, CEO
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Sep 2004
            • 5654

            #6
            This is strange, because there is no index with this name in 1.4.x database structure.
            Alexei Vladishev
            Creator of Zabbix, Product manager
            New York | Tokyo | Riga
            My Twitter

            Comment

            • rrr
              Senior Member
              • Sep 2007
              • 100

              #7
              You hast have to insert this line before the line with the new creation of the INDEX:

              Code:
               
              DROP INDEX httptest_httptest_1 ON httptest;

              Comment

              • xs-
                Senior Member
                Zabbix Certified Specialist
                • Dec 2007
                • 393

                #8
                One more thing to keep in mind (which could also be the cause of 'similar' issues)

                If for any reason patch.sql gives you an error, you can't simply 'do it again' (the patch.sql does not do an atomic commit).
                You will either need to figure out on which line it failed and continue from there, or restore a backup and try again.

                Comment

                • BlouPhil
                  Junior Member
                  • Nov 2007
                  • 12

                  #9
                  Thanks for you help!

                  I am currently dropping the DB and then I'll restore it, it's pretty big (2.2GB)

                  I've added :
                  DROP INDEX httptest_httptest_1 ON httptest;

                  just before the line :
                  CREATE INDEX httptest_httptest_1 on httptest (applicationid);

                  I'll post my results here once it's done

                  Comment

                  • gedp
                    Member
                    • May 2006
                    • 47

                    #10
                    had the same problem (upgrading from 1.4.1). Dropping the index and running the patch starting from the CREATE line was ok.

                    Comment

                    • BlouPhil
                      Junior Member
                      • Nov 2007
                      • 12

                      #11
                      It worked!

                      My DB is now patched, I'll be now upgrading the frontend and the binaries from source

                      Thanks a lot everyone for your fast help

                      Comment

                      Working...