Skip to content

Instantly share code, notes, and snippets.

@vangog
Created May 14, 2014 14:08
Show Gist options
  • Select an option

  • Save vangog/19115adcb45e926f1205 to your computer and use it in GitHub Desktop.

Select an option

Save vangog/19115adcb45e926f1205 to your computer and use it in GitHub Desktop.
#Replace xxx with your IP Address
bind-address = xxx.xxx.xxx.xxx
Or add a bind-address = 0.0.0.0 if you don't want to specify the IP
Then stop and restart MySQL with the new my.cnf entry. Once running go to the terminal and enter the following command.
lsof -i -P | grep :3306
That should come back something like this with your actual IP in the xxx's
mysqld 1046 mysql 10u IPv4 5203 0t0 TCP xxx.xxx.xxx.xxx:3306 (LISTEN)
If the above statement returns correctly you will then be able to accept remote users. However for a remote user to connect with the correct priveleges you need to have that user created in both the localhost and '%' as in.
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass';
CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypass';
GRANT ALL ON *.* TO 'myuser'@'localhost';
GRANT ALL ON *.* TO 'myuser'@'%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment