When I bought a new window machine, I would wipe window out and install linux. For window 11 machine I just bought, it has WSL. I want to try it.
Install WSL
- Log in, run as admin and install
wsl --install
- restart machine
- create user name and password
To use Ubuntu
- click start button, find Ubuntu and click it.
- another way is to open windon cmd terminal, click arrow, and choose Ubuntu
Install development tools
To install tools such as Docker, vscode and npm, please check docs and DO NOT install directly in ubuntu using apt install.
Install git
sudo apt update
sudo apt install git-all
Install node and npm
sudo apt-get install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
#restart terminal. Then
nvm install --lts
#see nodes installed
nvm ls
Access Window files from Linux
cd /mnt/c/Users/<your_Windows_username>
#for example
cd /mnt/c/Users/oldwe/Downloads/
cp prj-00-initial-starting-setup.zip ~/.
Install MySQL
sudo apt update
sudo apt install mysql-server
Start and access MySQL
# start MySQL server
systemctl status mysql
# open MySQL client as log in as root
sudo mysql
# create a new user
CREATE USER 'leo'@'localhost' IDENTIFIED BY 'test1234';
# normally should give privileges by db name.
GRANT ALL PRIVILEGES ON *.* TO 'leo'@'localhost';
In Summary, after install MySQL, to work with it, we need
#start server
systemctl status mysql
#login as root
sudo mysql
#login as a user
mysql -u leo --password=test1234
Debug
issue 1: Can not access docker daemon in Ubuntu after window update
Solution, need to enable docker desktop with wsl in docker desktop setting.