Ask Your Question
0

Owncloud migrating from SQLite to MySQL/MariaDB

asked 2014-11-14 08:19:51 -0500

Caterpillar gravatar image

updated 2014-11-16 03:11:04 -0500

In a Fedora system, I need to convert the Owncloud's SQLite database into a MySQL/MariaDB database I started installing MySQL:

# systemctl enable mysqld
# systemctl start mysqld
$ mysql_secure_installation

then

$ mysql -u root -p
  CREATE USER 'owncloud_user'@'localhost' IDENTIFIED BY '12345';
  CREATE DATABASE IF NOT EXISTS owncloud;
  GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud_user'@'localhost' IDENTIFIED BY '12345';

and let's assume that owncloud_user's password is 12345 Now, from Owncloud 7.0 admin manual, entering

# php occ db:convert-type --all-apps mysql owncloud_user 127.0.0.1 owncloud

I have been prompted for:

What is the database password?

Database password? I only created a password for user owncloud_user, so I entered the password 12345 but I obtain error

[PDOException]                                                                                   
SQLSTATE[HY000] [1045] Access denied for user 'owncloud_user'@'localhost' (using password: YES)

Additional infos:

the machine has IPv6 enabled

MariaDB [(none)]> SELECT user, host FROM mysql.user;
+---------------+-----------+                                                                                                                                                             
| user          | host      |                                                                                                                                                             
+---------------+-----------+
| root          | 127.0.0.1 |
| root          | ::1       |
| owncloud_user | localhost |
| root          | localhost |
+---------------+-----------+
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-11-14 10:21:29 -0500

baoboa gravatar image

updated 2014-11-17 12:12:02 -0500

  1. to create the database (with that i have no problem to connect)
  • mysql -u root -p
  • CREATE USER 'owncloud_user'@'localhost' IDENTIFIED BY '12345';
  • CREATE DATABASE IF NOT EXISTS owncloud;
  • GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud_user'@'localhost' IDENTIFIED BY '12345';
  1. to check your password
  • mysql -u owncloud_user -p -t owncloud
  1. to change it look at this link
  • SET PASSWORD FOR 'owncloud_user'@'localhost' = PASSWORD('23456');
  1. to clean it
  • mysql -u root-p
  • DROP DATABASE IF EXISTS owncloud;
  • DROP USER 'owncloud_user'@'localhost';
edit flag offensive delete link more

Comments

123456 was a mistype mistake during writing the question.

$ mysql -u owncloud_user -p -t owncloud

returns:

Enter password:

then

ERROR 1045 (28000): Access denied for user 'owncloud_user'@'localhost' (using password: YES)
Caterpillar gravatar imageCaterpillar ( 2014-11-15 08:16:22 -0500 )edit
0

answered 2014-11-25 03:12:35 -0500

Caterpillar gravatar image

A FLUSH PRIVILEGES fixed the problem. The correct SQL code is

$ mysql -u root -p
  CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
  CREATE DATABASE IF NOT EXISTS owncloud;
  GRANT ALL PRIVILEGES ON owncloud.* TO 'username'@'localhost' IDENTIFIED BY 'password';
  FLUSH PRIVILEGES;
edit flag offensive delete link more

Comments

it's not done by default when your are closing the mysql shell ?

baoboa gravatar imagebaoboa ( 2014-11-25 06:36:41 -0500 )edit

if it's the solution for you , check it as correct

baoboa gravatar imagebaoboa ( 2014-11-25 06:37:50 -0500 )edit

@baoboa for some absurd reasons with less of 20 points, you cannot mark as correct your own answers

Caterpillar gravatar imageCaterpillar ( 2014-11-30 15:44:07 -0500 )edit

bad karma i suppose :)

baoboa gravatar imagebaoboa ( 2014-12-01 08:50:02 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-11-14 08:19:51 -0500

Seen: 4,302 times

Last updated: Nov 25 '14