Install failed:1071 Specified key was too long;

modifications

#1

well,I use mysql as db, but install failed with following errors。

Error while trying to create admin user: An exception occurred while executing 'CREATE TABLE oc_dav_shares (id INT UNSIGNED AUTO_INCREMENT NOT NULL, principaluri VARCHAR(255) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, access SMALLINT DEFAULT NULL, resourceid INT UNSIGNED NOT NULL, UNIQUE INDEX dav_shares_index (principaluri, resourceid, type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes

I have to change some code to shord the key length, so that I can continue install。 I think it could be a big bug 。


#2

Do you have ownCloud 10.0.3?


#3

yes, it's 10.0.3. where can download a previous version?


#4

Well, I would rather try to solve the issue with your current setup, as 10.0.3 is the newest and greatest version of ownCloud. That means if this bug is in 10.0.3, it's probably in all the other versions too.

Can you tell me how exactly you set up ownCloud?

Can you post the content of your logs?

Can you show me your config.php?


#5

I setup it on a router that runs with LNMP and php+mysql+nginx.
about the log, I dont kown where is it, would u like to tell me ?
I've changed the file "Version20170101010100.php" , some key words as joined Index I have to change those from 255 to 166 so that owncloud can setup well 。
for example:

		$davSharesTable->addColumn(
			'principaluri',
			Type::STRING,
			[
				'default' => null,
				'length' => 166,
				'notnull' => false
			]
		);
		$davSharesTable->addColumn(
			'type',
			Type::STRING,
			[
				'default' => null,
				'length' => 166,
				'notnull' => false
			]
		);

because the formal definination: UNIQUE INDEX dav_shares_index (principaluri, resourceid, type) could be (255+255)x3 =1500 more than the MySql max allowed key leigth 1000。so I changed it to 166 。


#6

BTW UTF8 is 3 charaters leigth, so it need to multiply by 3


#7

the log could be found in the owncloud dir /data