Hey all.

Here's what happened:

I installed Drupal 6 dev on a Windows 2003 machine running IIS 6, mySQL 4.1, and php 5.
I entered in all of the information, including the admin account name, email, and password.
I got a time out error after 60 seconds.
I went back to the index.php page and logged in under the admin account.
I clicked "visit the administration section" and got:

Access denied
You are not authorized to access this page.

When I went in to view my account, no settings were available for me to change that would have anything to do with drupal permissions. This is the first account ever created for this drupal installation.

Comments

stborchert’s picture

Title: Admin account no permissions » Admin account no permissions: wrong uid after installation
Priority: Normal » Critical

Hi.
Same problem here.
- obtained a fresh copy of drupal 6.x from cvs
- setup new database
- inserted all required information and created admin account
- if I try to go to admin/* => "Access denied"
- menu only contains "My account" and "Log out"

Wondering why admin has uid = 2.
Ah, that's it!
After changing the uid to 1 in the database everything works fine.

stborchert’s picture

Ok, I had a closer look to whats happening there and found line 188 in system.install:
db_query("SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'");.
This doesn't seem to work on all mysql versions (mine is 4.1.11-nt), though it should work (added in MySQL 4.1.1).
Probably an additional ALTER TABLE {users} SET auto_increment=1 after inserting user 0 would solve this.

stborchert’s picture

Unfortuantely it doesn't solve this problem.
db_query("SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'"); is executed and returns TRUE but SHOW VARIABLES LIKE 'sql_mode' returns a blank result.
Even if I set the variable manually the uid is inserted wrong (auto_increment is set to 2 after creating account 0).

Weird.

webernet’s picture

Status: Active » Closed (duplicate)