gpt4 book ai didi

java.sql.SQLException : Access denied for user 'guacamole' @'172.17.0.4' in Guacamole Docker

转载 作者:行者123 更新时间:2023-11-29 16:10:35 24 4
gpt4 key购买 nike

我是 Guacamole 和 jetty worker 的新手。我正在使用 mysql 进行身份验证。

下面提到了我正在尝试的命令

docker run --name some-guacd -d guacamole/guacd
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:latest
docker run --name some-guacamole --link some-guacd:guacd --link some-mysql:mysql -e MYSQL_DATABASE=guacamole -e MYSQL_USER=guacamole -e MYSQL_PASSWORD=some_password -e MYSQL_ROOT_PASSWORD=root -v /local/path:/etc/guacamole -e GUACAMOLE_HOME=/etc/guacamole -d -p 8080:8080 guacamole/guacamole

但我遇到了以下提供的异常。

Fri Mar 22 07:59:36 UTC 2019 WARN: Establishing SSL connection without 
server's identity verification is not recommended. According to MySQL
5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established
by default if explicit option isn't set. For compliance with existing
applications not using SSL the verifyServerCertificate property is set to
'false'. You need either to explicitly disable SSL by setting useSSL=false,
or set useSSL=true and provide truststore for server certificate
verification.
Fri Mar 22 07:59:36 UTC 2019 WARN: Establishing SSL connection without
server's identity verification is not recommended. According to MySQL
5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established
by default if explicit option isn't set. For compliance with existing
applications not using SSL the verifyServerCertificate property is set to
'false'. You need either to explicitly disable SSL by setting useSSL=false,
or set useSSL=true and provide truststore for server certificate
verification.
07:59:36.126 [http-nio-8080-exec-7] ERROR o.a.g.rest.RESTExceptionMapper -
Unexpected internal error:
### Error querying database. Cause: java.sql.SQLException: Access denied
for user 'guacamole'@'172.17.0.4' (using password: YES)
### The error may exist in
org/apache/guacamole/auth/jdbc/user/UserMapper.xml
### The error may involve
org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
### The error occurred while executing a query
### Cause: java.sql.SQLException: Access denied for user
'guacamole'@'172.17.0.4' (using password: YES)

还有我的 Guacamole .properties

guacd-hostname:localhost
guacd-port:4822
lib-directory:/var/lib/guacamole/classpath

#basic-user-mapping:/etc/guacamole/user-mapping.xml
#auth-provider:
net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvide
auth-
provider:net.sourceforge.guacamole.net.auth.mysql
.MySQLAuthenticationProvider
mysql-hostname:127.0.0.1
mysql-port:3306
mysql-database:guacamole
mysql-username:guacamole
mysql-password:some_password

我不知道我哪里做错了?

最佳答案

Guacamole 没有像 MySQL 容器那样的 MYSQL_ROOT_PASSWORD 环境变量。相反,您指定要连接的用户名和密码。让容器相互协作的最简单方法如下:

docker run --name some-guacd -d guacamole/guacd
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=guacamole -d mysql:latest
docker run --name some-guacamole --link some-guacd:guacd --link some-mysql:mysql -e MYSQL_DATABASE=guacamole -e MYSQL_USER=root -e MYSQL_PASSWORD=root -v /local/path:/etc/guacamole -e GUACAMOLE_HOME=/etc/guacamole -d -p 8080:8080 guacamole/guacamole

我删除了 MYSQL_ROOT_PASSWORD 变量并更新了其他环境变量以反射(reflect)您的 MySQL 配置。我还更新了 MySQL 容器环境变量来创建您想要将 Guacamole 数据放入的数据库。

需要注意的一件重要事情:使用 root MySQL 用户运行 Guacamole 并不安全。我建议为 Guacamole 创建一个新的数据库用户来运行,并为其授予对数据库的适当权限。

关于java.sql.SQLException : Access denied for user 'guacamole' @'172.17.0.4' in Guacamole Docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55295421/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com