Skip to content

Instantly share code, notes, and snippets.

@nicoverbruggen
Last active March 27, 2022 22:34
Show Gist options
  • Save nicoverbruggen/9df2e319be8fbb22bd945b5e4881d809 to your computer and use it in GitHub Desktop.
Save nicoverbruggen/9df2e319be8fbb22bd945b5e4881d809 to your computer and use it in GitHub Desktop.
WSL 2.x and MySQL Server
# 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