0
votes

I am installing ownCloud in a machine that is running Arch Linux and that has MariaDB, PHP and Apache up and running. When I try to start ownCloud's installer, I get this error:

Error while trying to create admin user: An exception occurred while executing 'CREATE TABLE `oc_appconfig` (`appid` VARCHAR(32) DEFAULT '' NOT NULL, `configkey` VARCHAR(64) DEFAULT '' NOT NULL, `configvalue` LONGTEXT DEFAULT NULL, INDEX appconfig_config_key_index (`configkey`), PRIMARY KEY(`appid`, `configkey`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB': SQLSTATE[42000]: Syntax error or access violation: 1142 CREATE command denied to user 'owncloud'@'localhost' for table 'oc_appconfig' 

It seems to be a problem of permissions. But I don't know why it is happening:

sql> USE owncloud;
sql> CREATE USER 'owncloud'@'localhost' IDENTIFIED BY 'password';
sql> GRANT ALL PRIVILEGES ON owncloud TO 'owncloud'@'localhost' WITH GRANT OPTION;

If I check the privileges, they seem to be there:

sql> SHOW GRANTS FOR 'owncloud'@'localhost';
+-----------------------------------------------------------------------------------------------------------------+
| Grants for owncloud@localhost                                                                                   |
+-----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'owncloud'@'localhost' IDENTIFIED BY PASSWORD '*****************************************' |
| GRANT ALL PRIVILEGES ON `owncloud`.`owncloud` TO 'owncloud'@'localhost' WITH GRANT OPTION                       |
+-----------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

I've tried dropping the user and creating it again, but I get the same error. Any ideas?

2
Try granting full permissions if you can and see if it works: GRANT ALL PRIVILEGES ON star-dot-start TO 'owncloud'@'localhost'..you are right it has to be permissions! - n34_panda
It looks like it partially worked. Now I'm getting this: "Error while trying to create admin user: SQLSTATE[HY000] [1044] Access denied for user 'oc_user'@'localhost' to database 'owncloud'" - user3666271
Assuming you have permissions to actually create the user you could try using "127.0.0.1" instead (or as well as) localhost - bit of a long shot that I think. Instead confirm the user you are using to create the new user has the necessary permissions to do so. - n34_panda
The SHOW GRANTS is showing that the user does not have privilege to create tables in the owncloud database. To grant privileges on all objects in the database, use "on database dot star" ON owncloud.*. - spencer7593

2 Answers

0
votes

I'd recommend providing the mysql root user credentials. Given that, ownCloud should create its own user with restricted rights during setup.

0
votes

The following solution (which was found in a comment) worked for me:

Assuming you have permissions to actually create the user you could try using "127.0.0.1" instead (or as well as) localhost - bit of a long shot that I think. Instead confirm the user you are using to create the new user has the necessary permissions to do so.

@n34_panda May 23 '14 at 9:09 (original comment)