Risk of getting MySQL database compromised while accessing it with a windows application

I want to make an windows software for clients that clients can register inside the software and it will store the registration to an online MySQL.

However when i googled “how to do this”, I found that to establish such a MySQL connection I should provide a sql user with the right to modify the sql database. And I would also provide that sql user’s password. (All these should be in my code)

This comes to a problem, if someone decompiled my application, he can get my code, and get my sql user and password, and he can see and do anything to my sql database.

Is there anyway to prevent this?