I cannot access external services of MySQL,what should I do?

I built a spring boot project and deployed it with Kubernetes Deployment ,and its configuration file is as follows:

server:
  port: 80
spring:
  application:
    name: demo-kube-svca
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://mysql.dev.svc.cluster.local/kube
    username: root
    password: 123456

My mysql database is simple to deploy with docker:

Docker run -d \
-p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=123456 \
--name=mysql \
--privileged=true \
Mysql: 8.0

Finally, I want to import the MySQL service into Service Mesh with ServiceEntry .

apiVersion: networking.istio.io/v1alpha3
Kind: ServiceEntry
Metadata:
   Name: mysql-external
Spec:
   Hosts:
     - mysql.dev.svc.cluster.local
   Addresses:
     - 192.168.0.123/32
   Ports:
     - number: 3306
       Name: mysql
       Protocol: tcp
   Location: MESH_EXTERNAL

However, when I use the program to access the database, the error is reported in the log:

Caused by: java.net.UnknownHostException: mysql.dev.svc.cluster.local: Name does not resolve

I refer to the official documentation: https://istio.io/blog/2018/egress-tcp/, I think it may be a problem with my configuration, but I don’t know what to do, can you help me?

@Duke_Lu Try to name the port tcp. The requirements for port names are specified at https://istio.io/docs/setup/kubernetes/additional-setup/requirements/