Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-8803

failed to create an index on the columns "mnethostid" and "username

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8
    • Labels:
      None
    • Environment:
      WAMP
      Apache 2.2.4
      MySQL 5.0.33
      PHP 5.2.1

      Firefox 2.0.0.2
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      I'm performing an upgrade on my Moodle install to today's beta build of 1.8. I am receiving this error during the upgrade script:

      We failed to create an index on the columns "mnethostid" and "username" in your user table.
      This can occur when you have duplicate usernames in your user table.
      Your upgrade should still complete successfully. Click on the link above, and instructions on fixing this problem will appear in a new window. You can attend to that at the end of the upgrade.

      I went to the link, ran this code on my mdl_user table:

      select username,
      count(username) AS instances
      from mdl_user
      group by username
      having (count(username) > 1);

      It returned an empty set (zero rows). I checked again, and I have no duplicate usernames.

      After the Moodle upgrade, I ran the suggested code:

      CREATE UNIQUE INDEX user_mneuse_uix ON mdl_user (mnethostid, username);

      And it executed successfully.

      Yesterday's build of 1.8 beta did not have this issue.

        Attachments

          Activity

            People

            Assignee:
            donal@catalyst.net.nz Donal McMullan
            Reporter:
            smithrn Ryan Smith
            Tester:
            Nobody
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              31/Mar/07