Ask Your Question
0

What is the process to establish a direct connection between DBeaver and MySQL on Kubernetes without relying on kubectl port-forwarding?

asked 2022-10-04 11:00:00 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-03-05 18:00:00 +0000

bukephalos gravatar image

To establish a direct connection between DBeaver and MySQL on Kubernetes without relying on kubectl port-forwarding, you can follow these steps:

  1. Create a Kubernetes service for the MySQL pod or deployment that you want to connect to. This service should expose port 3306, which is the default MySQL port.

  2. Get the hostname and port number of the Kubernetes service that you just created. You can use the following command to get this information:

    kubectl get svc <service-name>
    

    Replace <service-name> with the name of your Kubernetes service.

  3. Configure DBeaver to use the hostname and port number of the Kubernetes service to connect to MySQL. You can create a new database connection in DBeaver and use the following settings:

    • Database driver: MySQL
    • Host: <service-host>
    • Port: <service-port>
    • Database: <database-name>
    • User: <database-user>
    • Password: <database-password>

    Replace <service-host> and <service-port> with the hostname and port number of your Kubernetes service. Replace <database-name>, <database-user> and <database-password> with the name, user and password of your MySQL database.

  4. Test the connection to MySQL by clicking the "Test connection" button in DBeaver. If the connection is successful, you should be able to see the list of databases and tables in your MySQL database in the DBeaver interface.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-10-04 11:00:00 +0000

Seen: 9 times

Last updated: Mar 05 '23