ownCloud设置:SQLSTATE[HY000][1045]访问,用户自己的云“@localhost”被拒绝(使用密码:YES)

时间:2022-09-19 21:17:24

I wanted to setup my owncloud installation on my raspberry pi 2. So, I created an mysql database and user.

我想在树莓派2上安装我自己的云设备。我创建了一个mysql数据库和用户。

CREATE DATABASE owncloud;

CREATE USER 'owncloud'@'localhost' IDENTIFIED BY 'Password';
GRANT ALL PRIVILEGES ON owncloud. * TO 'owncloud'@'localhost';
FLUSH PRIVILEGES;

After I type all nessesairy parameters into the webinterface of the owncloud-setup, I recevied:

在我将所有的nessesairy参数输入到自己的云设置的webinterface后,我就会说:

Error while trying to create admin user: Failed to connect the database: An exeption occured in driver: SQLSTATE[HY000][1045] Access denied for user 'owncloud'@'localhost' (using password:YES)

尝试创建admin用户时出错:连接数据库失败:在driver: SQLSTATE[HY000][1045]中发生了一个调用,用户“owncloud”@“localhost”访问被拒绝(使用密码:YES)

Sadly, my resent sreach on similar topics didn't result in any functional hint on this problem. So, I would be happy about further suggestions.

遗憾的是,我对类似主题的最新研究并没有在这个问题上得到任何有用的提示。所以,我很高兴有更多的建议。

4 个解决方案

#1


2  

  1. Look at this: https://doc.owncloud.org/server/9.0/admin_manual/installation/installation_wizard.html#database-choice
  2. 看看这个:https://doc.owncloud.org/server/9.0/admin_manual/installation/installation_wizard.html数据库选项
  3. In Terminal: mysql_upgrade --force -u root -p
  4. 在终端:mysql_upgrade——force -u root -p
  5. Use administrative MySQL »root«-user and password with the Installation Wizard
  6. 使用管理的MySQL»root«-user和password with the Installation Wizard
  7. Check that the Database not exist which you create with the Installation Wizard
  8. 检查您使用安装向导创建的数据库是否不存在
  9. If nothing helps, start with sqlite, then migrate to mysql like this: https://doc.owncloud.org/server/9.0/admin_manual/configuration_database/db_conversion.html
  10. 如果没有任何帮助,那么从sqlite开始,然后像这样迁移到mysql: https://doc.owncloud.org/server/9.0/admin_manual/configuration_database/db_conversion.html

#2


1  

Just replace localhost for 127.0.0.1 in Owncloud's setup form for MySQL as mentioned in comments above by Askaga

只需将localhost替换为127.0.0.1,就像Askaga在上面的注释中提到的那样

#3


0  

For some reason, explicitly re-access the database from the terminal solves the problem for me. Just give mysql an empty line with

由于某种原因,从终端显式地重新访问数据库为我解决了问题。给mysql一个空行。

mysql -u root -e ";"

This should be an individual command after you created database and database user.

这应该是创建数据库和数据库用户后的单个命令。

Sure, you should always check whether

当然,你应该经常检查一下

  1. There are users with an empty username. Remove them.

    用户名为空。移除它们。

  2. Remove "test" database.

    删除“测试”数据库。

  3. Grant appropriate permission to your database user.

    向数据库用户授予适当的权限。

  4. Last but not least FLUSH PRIVILEGES;.

    最后但并非最不重要的特权;

Search other posts for instructions. I'm just providing a possible solution if you come across a situation where none of the above works.

搜索其他文章以获得指导。我只是提供一个可能的解决方案,如果您遇到的情况,上述任何一种都不起作用。

Here's a good example to properly setup mysql after installation. FYI.

下面是安装后正确设置mysql的一个很好的例子。仅供参考。

#4


0  

Mask the DB password in the installation screen (the password should not be visible, only dots) and retry.

屏蔽安装屏幕中的DB密码(密码不应该是可见的,只有点)并重试。

#1


2  

  1. Look at this: https://doc.owncloud.org/server/9.0/admin_manual/installation/installation_wizard.html#database-choice
  2. 看看这个:https://doc.owncloud.org/server/9.0/admin_manual/installation/installation_wizard.html数据库选项
  3. In Terminal: mysql_upgrade --force -u root -p
  4. 在终端:mysql_upgrade——force -u root -p
  5. Use administrative MySQL »root«-user and password with the Installation Wizard
  6. 使用管理的MySQL»root«-user和password with the Installation Wizard
  7. Check that the Database not exist which you create with the Installation Wizard
  8. 检查您使用安装向导创建的数据库是否不存在
  9. If nothing helps, start with sqlite, then migrate to mysql like this: https://doc.owncloud.org/server/9.0/admin_manual/configuration_database/db_conversion.html
  10. 如果没有任何帮助,那么从sqlite开始,然后像这样迁移到mysql: https://doc.owncloud.org/server/9.0/admin_manual/configuration_database/db_conversion.html

#2


1  

Just replace localhost for 127.0.0.1 in Owncloud's setup form for MySQL as mentioned in comments above by Askaga

只需将localhost替换为127.0.0.1,就像Askaga在上面的注释中提到的那样

#3


0  

For some reason, explicitly re-access the database from the terminal solves the problem for me. Just give mysql an empty line with

由于某种原因,从终端显式地重新访问数据库为我解决了问题。给mysql一个空行。

mysql -u root -e ";"

This should be an individual command after you created database and database user.

这应该是创建数据库和数据库用户后的单个命令。

Sure, you should always check whether

当然,你应该经常检查一下

  1. There are users with an empty username. Remove them.

    用户名为空。移除它们。

  2. Remove "test" database.

    删除“测试”数据库。

  3. Grant appropriate permission to your database user.

    向数据库用户授予适当的权限。

  4. Last but not least FLUSH PRIVILEGES;.

    最后但并非最不重要的特权;

Search other posts for instructions. I'm just providing a possible solution if you come across a situation where none of the above works.

搜索其他文章以获得指导。我只是提供一个可能的解决方案,如果您遇到的情况,上述任何一种都不起作用。

Here's a good example to properly setup mysql after installation. FYI.

下面是安装后正确设置mysql的一个很好的例子。仅供参考。

#4


0  

Mask the DB password in the installation screen (the password should not be visible, only dots) and retry.

屏蔽安装屏幕中的DB密码(密码不应该是可见的,只有点)并重试。