Hasura Cloud의 MySQL 데이터베이스에 연결하는 중 오류가 발생했습니다.
P粉296080076
P粉296080076 2023-08-15 10:54:43
0
1
492
<p>我正在使用Hasura云环境。对于MySQL数据库,我正在使用MySQL Workbench并创建了一个数据库。我想在Hasura环境中使用这个数据库。MySQL服务器在端口3306上运行。 我的JDBC连接字符串是: <code>jdbc:mysql://localhost:3306/employees?user=admin&amp;password=password@123</code> 连接后,我得到了这个错误</p> <pre class="brush:php;toolbar:false;">[ { "definition": "employees", "message": { "stacktrace": "com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failurennThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.ntat com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)ntat com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)ntat com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:828)ntat com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:448)ntat com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241)ntat com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)ntat io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:226)ntat io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:536)ntat io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:517)ntat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)ntat io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)ntat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)ntat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)ntat java.base/java.lang.Thread.run(Thread.java:833)nCaused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failurennThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.ntat jdk.internal.reflect.GeneratedConstructorAccessor53.newInstance(Unknown Source)ntat java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)ntat java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)ntat java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)ntat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)ntat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)ntat com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)ntat com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)ntat com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89)ntat com.mysql.cj.NativeSession.connect(NativeSession.java:120)ntat com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:948)ntat com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:818)nt... 11 morenCaused by: java.net.ConnectException: Connection refusedntat java.base/sun.nio.ch.Net.connect0(Native Method)ntat java.base/sun.nio.ch.Net.connect(Net.java:579)ntat java.base/sun.nio.ch.Net.connect(Net.java:568)ntat java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)ntat java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)ntat java.base/java.net.Socket.connect(Socket.java:633)ntat com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:153)ntat com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63)nt... 14 moren" }, "name": "source employees", "reason": "Inconsistent object: Communications link failurennThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.", "type": "source" } ]</pre> <p>在云环境中使用本地SQL数据库是否被允许?还是我们必须使用云上的MySQL数据库。 我有一个小疑问。密码中包含的<code>@</code>符号是否有问题!</p>
P粉296080076
P粉296080076

모든 응답(1)
P粉959676410

localhostOn Hasura Cloud는 Hasura Cloud 인프라 내부에서 실행되는 컨테이너의 로컬 네트워크를 가리킵니다

MySQL 데이터베이스가 Hasura Cloud 엔진 인스턴스로 실행되지 않으므로 클라우드 네트워크 내부에서 볼 수 있는 데이터베이스 주소를 Hasura에 제공해야 합니다.

외부 IP 주소 또는 도메인 이름이 됩니다.

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿