Last active
January 8, 2021 20:53
-
-
Save alanzhaonys/d42d3925e947fc8f9cfc4cc9c8fd6a44 to your computer and use it in GitHub Desktop.
MySQL remote access on Centos 8 and Httpd
This file contains 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. Setup user | |
2. Add binding_address = 0.0.0.0 to my.cnf | |
3. Open up firewall below | |
# https://wiki.mikejung.biz/Firewalld | |
# Allow traffic to MySQL | |
yum install @mysql | |
systemctl enable mysqld | |
systemctl start mysqld | |
systemctl status mysqld | |
mysql_secure_installation | |
# Create user | |
# CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'user_password'; | |
# GRANT ALL PRIVILEGES ON *.* TO 'database_user'@'localhost' WITH GRANT OPTION; | |
# FLUSH PRIVILEGES; | |
firewall-cmd --zone=public --add-service=mysql --permanent | |
systemctl restart firewalld | |
firewall-cmd --list-all | |
HTTPD | |
==== | |
yum install httpd | |
yum install mod_ssl | |
systemctl enable httpd | |
systemctl start httpd | |
systemctl status httpd | |
mysql_secure_installation | |
firewall-cmd --permanent --zone=public --add-service=http | |
firewall-cmd --permanent --zone=public --add-service=https | |
systemctl restart firewalld | |
firewall-cmd --list-all | |
PHP | |
==== | |
yum install php php-mysqlnd php-pdo php-gd php-mbstring php-dom php-curl php-intl php-json php-ldap php-xml php-zip php-opcache | |
systemctl restart httpd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment