DEV Community

loading...

Discussion on: Setting up WSL 2 for Web Development

Collapse
doniking profile image
Don

Running mysql on windows will slowdown your wsl 2 app.
I moved mysql from windows to inside the wsl 2, and my app response is increase 10 times.

Collapse
hymanzhan profile image
Xucong ZHAN Author

Definitely, and that's to be expected with any local vs remote network access comparison. Network latency is so much higher with the latter.
A simple test, which confirms your number of 10 times faster:
Remote vs Local

Collapse
bidipeppercrap profile image
Fransisco Wijaya

How can I start mysql automatically on WSL startup?

Thread Thread
hymanzhan profile image
Xucong ZHAN Author • Edited

I am afraid I don't have the best answer. The WSL distros aren't managed by systemd so normal ways of sudo systemctl enable xxx.service won't work. You can try adding sh -c "sudo service mysql start" at the end of .zshrc or .bashrc file.

Thread Thread
bidipeppercrap profile image