我已经按照here的说明操作了guacd、guacamole和mysql,它们运行在不同的容器中,并连接在一起。我很有信心我的配置是正确的,作为测试,我启动了一个普通的ubuntu容器,安装了mysql-client,并连接到mysql容器:
PS > docker exec -it ubuntu bash
root@f31a3436f297:/# mysql -h test-mysql -u guacamole_user -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 22
Server version: 8.0.32 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use guacamole_db;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+---------------------------------------+
| Tables_in_guacamole_db |
+---------------------------------------+
| guacamole_connection |
| guacamole_connection_attribute |
| guacamole_connection_group |
| guacamole_connection_group_attribute |
| guacamole_connection_group_permission |
| guacamole_connection_history |
| guacamole_connection_parameter |
| guacamole_connection_permission |
| guacamole_entity |
| guacamole_sharing_profile |
| guacamole_sharing_profile_attribute |
| guacamole_sharing_profile_parameter |
| guacamole_sharing_profile_permission |
| guacamole_system_permission |
| guacamole_user |
| guacamole_user_attribute |
| guacamole_user_group |
| guacamole_user_group_attribute |
| guacamole_user_group_member |
| guacamole_user_group_permission |
| guacamole_user_history |
| guacamole_user_password_history |
| guacamole_user_permission |
+---------------------------------------+
23 rows in set (0.00 sec)
mysql>
但是,访问localhost:8080/guacamole
会导致以下结果:
在鳄梨酱集装箱日志中,我看到了这个:
2023-03-16 16:42:29 16:42:29.866 [http-nio-8080-exec-6] WARN o.a.g.e.AuthenticationProviderFacade - The "mysql" authentication provider has encountered an internal error which will halt the authentication process. If this is unexpected or you are the developer of this authentication provider, you may wish to enable debug-level logging. If this is expected and you wish to ignore such failures in the future, please set "skip-if-unavailable: mysql" within your guacamole.properties.
2023-03-16 16:42:29 16:42:29.869 [http-nio-8080-exec-6] ERROR o.a.g.rest.RESTExceptionMapper - Unexpected internal error:
2023-03-16 16:42:29 ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
2023-03-16 16:42:29
2023-03-16 16:42:29 The last packet successfully received from the server was 63 milliseconds ago. The last packet sent successfully to the server was 62 milliseconds ago.
2023-03-16 16:42:29 ### The error may exist in org/apache/guacamole/auth/jdbc/user/UserMapper.xml
2023-03-16 16:42:29 ### The error may involve org.apache.guacamole.auth.jdbc.user.UserMapper.selectOne
2023-03-16 16:42:29 ### The error occurred while executing a query
2023-03-16 16:42:29 ### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
2023-03-16 16:42:29
2023-03-16 16:42:29 The last packet successfully received from the server was 63 milliseconds ago. The last packet sent successfully to the server was 62 milliseconds ago.
从一些快速的google搜索来看,似乎Communications link failure
可能是错误的一个模糊的近似值,但是我被卡住了下一步该去哪里看。
我尝试过的事情,没有成功:
- 运行mysql:5.7
- 为鳄梨酱用户指定
WITH mysql_native_password
2条答案
按热度按时间vc9ivgsu1#
也有同样的问题,解决方法是
到
docker-compose.yml
中的鳄梨色拉酱容器的environment
。希望这个有用。
f8rj6qna2#
我也有同样的问题,这里是我的解决方案可能会帮助一些人。我从docker中删除
--link
,并设置-e GUACD_HOSTNAME=172.17.0.2 -e MYSQL_HOSTNAME=172.17.0.3
,但我不知道为什么