To grant remote access here are the steps:
Step 1. Edit the file etc/my.cnf and add these lines on [mysqld_safe]
[mysqld_safe]
Port = 3306
bind-address = 192.168.0.254 ( Address of the Apache server which is going to access the remote database server)
Step 2. Allow httpd_can_network_connect_db (here is how)
Step 3: Allow 3306/tcp port through firewall using the command
# firewall -cmd --permanent --zone = trusted --add-port = 3306/tcp
Step 3. Add the apache server address to firewall
# firewall-cmd --permanent --zone = trusted --add-source = 192.168.0.254/32 (Address of the Apache server, that will access the remote database server)
Step 4. Reload firewall
# firewall-cmd --reload
Step 5. Restart Service
# service httpd restart
# service mysqld reload
0 comments:
Post a Comment