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.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners