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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners