You have a MySql server running on Windows perhaps with XAMPP. You also have Wsl2 and want to access that database from Wsl2 for your for your application. I assume you have XAMPP running already and have Apache and MySql started and you've also created a table you want to access.
Now, there is an alternative method to do this, using Windows Cmd or Shell from XAMPP and connecting to the MySql database directly and type in some SQL code directly.
Congratulations, you've connected to your MySql database on your Windows host from Wsl2.