Error while connecting to jdbc MySQL. jdbc communication link failure. The last packet sent successfully to the server was 0 milliseconds ago.
조회 수: 22 (최근 30일)
이전 댓글 표시
Hi,
Error while connecting to database. The communication fails with the below error message.
jdbc communication link failure. The last packet sent successfully to the server was 0 milliseconds ago.
Below are the commands entered by me.
opts = configureJDBCDataSource('Vendor','MySQL');
opts = setConnectionOptions(opts, ...
'DataSourceName','MySQL80',...
'Server','localhost','PortNumber',3306, ...
'JDBCDriverLocation','C:\Users\JSRD\Downloads\mysql-connector-java-8.0.30\mysql-connector-java-8.0.30\mysql-connector-java-8.0.30.jar');
username = "root";
password = "root";
[status,msg] = testConnection(opts,username,password);
Kindly request you to resolve the same.
댓글 수: 0
답변 (1개)
Harald
2024년 1월 9일
Hi,
One possible cause is that the service is not running.
Open "Services" in Windows in administrator mode, find MySQL, right-click and select "Start".
Best wishes,
Harald
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Database Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!