[Owncloud] Error while installing owncloud-2.0.1 with MySQL
Μακρίδης Χρήστος
cmakridis at gmail.com
Thu Dec 22 12:24:56 UTC 2011
Hello everybody,
Please excuse me for any mistakes I might do (linguistic or others), as
well as for the long message.
First of all I will have to say that I bypassed this problem by using
sqlite. I 'm just reporting this in case there is something that
could/should be fixed, that exceeds my knowledge to locate.
My environment consists of a Debian 6.0.3 Squeeze box, with apache
(2.2.16-6+squeeze4), PHP (5.3.3-7+squeeze3) and MySQL
(5.3.3-7+squeeze3). (versions as reported by apt).
I used owncloud-2.0.1.tar.bz2.
I gave the installer the MySQL root user and password and DB_Owncloud2
as a Database name, just to get the following error.
[Error message: Could not execute statement] [Last executed query:
CREATE DATABASE `db_owncloud2` DEFAULT CHARACTER SET 'utf8'] [Native
code: 1044] [Native message: Access denied for user
'oc_mysql_xxxxxxxx'@'localhost' to database 'db_owncloud2'] MDB2 Error:
insufficient permissions: _doQuery: [Error message: Could not execute
statement] [Last executed query: CREATE DATABASE `db_owncloud2` DEFAULT
CHARACTER SET 'utf8'] [Native code: 1044] [Native message: Access denied
for user 'oc_mysql_xxxxxxx'@'localhost' to database 'db_owncloud2']
At this point I saw from MySQL that the database has been created, as
well as ONE user (host being %), but there are no tables inside the
database.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| DB_OwnCloud2 |
| mysql |
+--------------------+
mysql> use DB_OwnCloud2;
Database changed
mysql> show tables;
Empty set (0.00 sec)
mysql> use mysql;
mysql> select * from user where user like 'oc%';
+-----------+------------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| Host | User |
Password | Select_priv | Insert_priv |
Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv |
Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv
| Index_priv | Alter_priv | Show_db_priv | Super_priv |
Create_tmp_table_priv | Lock_tables_priv | Execute_priv |
Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv |
Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv
| Trigger_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject |
max_questions | max_updates | max_connections | max_user_connections |
+-----------+------------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| localhost | oc_mysql_xxxxxxx |
*pppppppppppppppppppppppppppppppppppppppp | N | N |
N | N | N | N | N |
N | N | N | N | N
| N | N | N | N |
N | N | N |
N | N | N | N |
N | N | N | N
| N | | | |
| 0 | 0 | 0 | 0 |
| % | oc_mysql_xxxxxxx |
*pppppppppppppppppppppppppppppppppppppppp | N | N |
N | N | N | N | N |
N | N | N | N | N
| N | N | N | N |
N | N | N |
N | N | N | N |
N | N | N | N
| N | | | |
| 0 | 0 | 0 | 0 |
+-----------+------------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
2 rows in set (0.06 sec)
mysql> select * from db where user like 'oc%';
+------+--------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| Host | Db | User | Select_priv | Insert_priv |
Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv |
References_priv | Index_priv | Alter_priv | Create_tmp_table_priv |
Lock_tables_priv | Create_view_priv | Show_view_priv |
Create_routine_priv | Alter_routine_priv | Execute_priv | Event_priv |
Trigger_priv |
+------+--------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| % | DB_OwnCloud2 | oc_mysql_xxxxxxx | Y | Y |
Y | Y | Y | Y | N |
Y | Y | Y | Y |
Y | Y | Y |
Y | Y | Y | Y |
Y |
+------+--------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
1 row in set (0.08 sec)
Grabbing the dbpassword from config/config.php, I managed to connect to
the database with "mysql -u oc_mysql_xxxxxxx -p" but what caught my
attention was his rights.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| DB_OwnCloud2 |
+--------------------+
2 rows in set (0.06 sec)
mysql> show grants;
+-------------------------------------------------------------------------------------------------------------------------+
| Grants for
oc_mysql_xxxxxxx at localhost
|
+-------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'oc_mysql_xxxxxxx'@'localhost' IDENTIFIED BY
PASSWORD '*pppppppppppppppppppppppppppppppppppppppp' |
+-------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
my (wild?) guess is that the attempt to create the tables is being made
with this user, who has no right to do so. (grant usage instead of grant
all)
At this point I tried to resubmit the configuration form, which led me
to a different, yet relevant error this time.
[Error message: Table 'DB_OwnCloud2.users' doesn't exist] [Native code:
1146] [Native message: Table 'DB_OwnCloud2.users' doesn't exist] MDB2
Error: connect failed: _doConnect: [Error message: Table
'DB_OwnCloud2.users' doesn't exist] [Native code: 1146] [Native message:
Table 'DB_OwnCloud2.users' doesn't exist]'
after which I noticed that a second DB user has been created with
localhost as Host this time.
mysql> use mysql;
mysql> select * from user where user like 'oc%';
+-----------+------------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| Host | User |
Password | Select_priv | Insert_priv |
Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv |
Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv
| Index_priv | Alter_priv | Show_db_priv | Super_priv |
Create_tmp_table_priv | Lock_tables_priv | Execute_priv |
Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv |
Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv
| Trigger_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject |
max_questions | max_updates | max_connections | max_user_connections |
+-----------+------------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
| localhost | oc_mysql_xxxxxxx |
*pppppppppppppppppppppppppppppppppppppppp | N | N |
N | N | N | N | N |
N | N | N | N | N
| N | N | N | N |
N | N | N |
N | N | N | N |
N | N | N | N
| N | | | |
| 0 | 0 | 0 | 0 |
| % | oc_mysql_xxxxxxx |
*pppppppppppppppppppppppppppppppppppppppp | N | N |
N | N | N | N | N |
N | N | N | N | N
| N | N | N | N |
N | N | N |
N | N | N | N |
N | N | N | N
| N | | | |
| 0 | 0 | 0 | 0 |
+-----------+------------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+
2 rows in set (0.03 sec)
while from rights point of view:
mysql> show grants for 'oc_mysql_xxxxxxx'@'localhost';
+-------------------------------------------------------------------------------------------------------------------------+
| Grants for
oc_mysql_xxxxxxx at localhost
|
+-------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'oc_mysql_xxxxxxx'@'localhost' IDENTIFIED BY
PASSWORD '*pppppppppppppppppppppppppppppppppppppppp' |
+-------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.11 sec)
mysql> show grants for 'oc_mysql_xxxxxxx'@'%';
+-----------------------------------------------------------------------------------------------------------------+
| Grants for
oc_mysql_xxxxxxx@%
|
+-----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'oc_mysql_xxxxxxx'@'%' IDENTIFIED BY PASSWORD
'*pppppppppppppppppppppppppppppppppppppppp' |
| GRANT ALL PRIVILEGES ON `DB_OwnCloud2`.* TO
'oc_mysql_xxxxxxx'@'%' |
+-----------------------------------------------------------------------------------------------------------------+
2 rows in set (0.02 sec)
(shouldn't grant all be limited to localhost only???)
As far as I can tell, the error occurs at lib/setup.php line 128.
At this point I thought I'd try to comment lines 127 - 129, 131, to
force "OC_DB::createDbFromStructure('db_structure.xml');" to be
executed, just to get the following error
[Error message: unable to establish a connection] [Native code: 0] MDB2
Error: connect failed: _doConnect: [Error message: unable to establish a
connection] [Native code: 0]
At this point I decided to write this mail and use sqlite instead of
MySQL :p
I'm afraid that the level of my knowledge of PHP does not allow me to
dig any deeper, but I am willing to provide any other information that
could be useful.
In the next few days I hope I will have the chance to try owncloud 3 as
well (never used git before :redface:) so as to see if the same thing
happens there to.
Thank you all very much for your time.
Kind regards,
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20111222/dbe29934/attachment.html>
More information about the Owncloud
mailing list