Database Creation failed

Database Creation failed

Nosūtīja Steve Dalton
Atbilžu skaits: 6
Hi All

Just discovered Moodle after reading the recent Linux Journal article. Looks interesting so thought I'd give it a try.

Just tried my first install - have installed via CVS from 1.4 Stable branch. Everything going well - until I got to the database creation part... everything created successfully apart from one:

(mysql): CREATE TABLE `mdl_user_teachers` ( `id` int(10) unsigned NOT NULL auto_increment, `userid` int(10) unsigned NOT NULL default '0', `course` int(10) unsigned NOT NULL default '0', `authority` int(10) NOT NULL default '3', `role` varchar(40) NOT NULL default '', `editall` int(1) unsigned NOT NULL default '1', `timestart` int(10) unsigned NOT NULL default '0', `timeend` int(10) unsigned NOT NULL default '0', `timemodified` int(10) unsigned NOT NULL default '0', `timeaccess` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), KEY UNIQUE `courseuserid` (course, userid), KEY `userid` (userid)) TYPE=MyISAM COMMENT='One record per teacher per course'

1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNIQUE `courseuserid` (course,userid), KEY `userid` (userid))

adodb_mysql._execute(CREATE TABLE `mdl_user_teachers` ( `id` int(10) unsigned NOT NU..., false) % line 804, file: adodb.inc.php

adodb_mysql.execute(CREATE TABLE `mdl_user_teachers` ( `id` int(10) unsigned NOT NU...) % line 30, file: datalib.php

execute_sql() % line 152, file: datalib.php

modify_database(CREATE TABLE `mdl_user_teachers` ( `id` int(10) unsigned NOT NU...) % line 111, file: index.php

Error

Any help much appreciated!

Steve
Vidējais novērtējums: -
Atbildot uz Steve Dalton

Re: Database Creation failed

Nosūtīja Paul Perger

Hi!

I had the same problem, I think the error is that

KEY UNIQUE `courseuserid`

should be

UNIQUE KEY `courseuserid`.

If you know how to use sql (for example in phpmyadmin) you can copy the whole thing from "CREATE TABLE ..." to "...'One record per teacher per course'" into your sql-interface, correct the thing mentioned above and create the missing table this way. At least it worked with my installation although I consider this a bug in the latest version.

Paul


Atbildot uz Paul Perger

Re: Database Creation failed

Nosūtīja Penny Leach
Hi,

This is now fixed in CVS so try cvs update if you're using CVS, and if not, I'm not sure what time the nightlies are built... but the fix will be in the next one.

Cheers
Penny
Atbildot uz Penny Leach

Re: Database Creation failed

Nosūtīja thierry reygnier
hello

I had the same problem in trying to make a new moodle test site. I prepare a training day to show at several admin how to use and install moodle easily... (from downloading the archive to the final screen of a well install..).

Hopping that the next archive would be ok...

Thanks so much for your job... and excuse my poor english...


Atbildot uz thierry reygnier

Re: Database Creation failed

Nosūtīja Martín Langhoff
You can always use 1.4.2 instead if 1.4.2+.
Atbildot uz Martín Langhoff

Re: Database Creation failed

Nosūtīja Jan Joost de Vries
What php file contains this statement? I have dropped all tables and want to use the fixed script and re run the installation.

Joost