Skip to content

Instantly share code, notes, and snippets.

@Nav-Appaiya
Created January 17, 2020 14:38
Show Gist options
  • Select an option

  • Save Nav-Appaiya/f30e71290e0f124e32148999cd11c318 to your computer and use it in GitHub Desktop.

Select an option

Save Nav-Appaiya/f30e71290e0f124e32148999cd11c318 to your computer and use it in GitHub Desktop.
# Spin up a docker mysql server with remote access
docker run --name mysql-server \
-p 3306:3306 -p 33060:33060 \
-e MYSQL_ROOT_HOST='%' -e MYSQL_ROOT_PASSWORD='root' \
-d mysql/mysql-server:latest
# login into the machine and create a nav user with nav password
# connect
mysql -u root -p -h 0.0.0.0
# create
CREATE USER 'nav' IDENTIFIED BY 'nav';
# grant privileges
GRANT ALL on *.* to 'nav'@'%' identified by 'nav';
#flush privileges
FLUSH PRIVILEGES;
exit -> try connecting now with remote server address and credentials.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment