Skip to content

Instantly share code, notes, and snippets.

@vordan
Created November 17, 2020 13:03
Show Gist options
  • Save vordan/1822a4498b60effd38737d09f4b26c3f to your computer and use it in GitHub Desktop.
Save vordan/1822a4498b60effd38737d09f4b26c3f to your computer and use it in GitHub Desktop.
Allow remote connection to MySQL
1. Edit the config file
vi /etc/mysql/mysql.conf.d/mysqld.cnf
Change
bind-address = 127.0.0.1
to
bind-address = 0.0.0.0
2. Restart mysql
systemctl restart mysql
3. Login to the server and create user
mysql -uroot -pinfop
CREATE USER 'root'@'localhost' IDENTIFIED BY 'infop';
CREATE USER 'root'@'%' IDENTIFIED BY 'infop';
GRANT ALL ON *.* TO 'root'@'localhost';
GRANT ALL ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;
EXIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment