0

我是鳄梨酱和码头工人的新手。我正在使用 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

我不确定我在哪里做错了?

4

1 回答 1

0

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

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变量并更新了其他环境变量以反映您的 MySQL 配置。我还更新了 MySQL 容器环境变量以创建您希望 Guacamole 数据进入的数据库。

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

于 2019-03-22T16:19:56.547 回答