Created
November 17, 2020 13:03
-
-
Save vordan/1822a4498b60effd38737d09f4b26c3f to your computer and use it in GitHub Desktop.
Allow remote connection to MySQL
This file contains hidden or 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
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