Last active
March 27, 2022 22:34
-
-
Save nicoverbruggen/9df2e319be8fbb22bd945b5e4881d809 to your computer and use it in GitHub Desktop.
WSL 2.x and MySQL Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allow access to SQL | |
UPDATE mysql.user SET plugin='mysql_native_password' WHERE User='root' | |
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root' | |
# You should now have access via: `mysql -u root -p` using the password `root` | |
# Allow access via any host | |
CREATE USER 'root'@'%' IDENTIFIED BY 'root'; | |
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; | |
# Allow access via your own PC | |
CREATE USER 'root'@'<hostname>.mshome.net' IDENTIFIED BY 'root'; | |
GRANT ALL PRIVILEGES ON *.* TO 'root'@'<hostname>.mshome.net' | |
FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment