在 Fedora 系统中,我需要将 Owncloud 的 SQLite 数据库转换为 MySQL/MariaDB 数据库,我开始安装 MySQL:
# systemctl enable mysqld
# systemctl start mysqld
$ mysql_secure_installation
然后
$ 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';
让我们假设 owncloud_user 的密码是12345
Now,从Owncloud 7.0 admin manual输入
# php occ db:convert-type --all-apps mysql owncloud_user 127.0.0.1 owncloud
我被提示:
What is the database password?
数据库密码?我只为用户owncloud_user创建了一个密码,所以我输入了密码12345
但我得到了错误
[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'owncloud_user'@'localhost' (using password: YES)
附加信息:
机器启用了 IPv6
MariaDB [(none)]> SELECT user, host FROM mysql.user;
+---------------+-----------+
| user | host |
+---------------+-----------+
| root | 127.0.0.1 |
| root | ::1 |
| owncloud_user | localhost |
| root | localhost |
+---------------+-----------+
你可以尝试指定 127.0.0.1 和/或 ::1 ,像这样
原因是这样的: http: //dev.mysql.com/doc/refman/5.0/en/connecting.html
您需要从 mysql 数据库中的授权表中重新加载权限。你可以这样做: