Hi, I've made an application and it connects to my database.

But the issue is the details of the database can be found out through packet logging or something.

How can I stop this from happening and secure it, without having to have a third party such as PHP script etc.

Thanks

You can use an encrypted mysql connection. I've never used mysql, only MS SQL and never in an environment that required encryption so I can't walk you through it but if you google "encrypted mysql connection" you might find what you need.

Try here which states

Using encryption

This one activates SSL encryption for all data sent between the client and server. The server needs to have a
certificate installed.
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Encryption=true;

and here