2.3. Configuring network access to MySQL
You must configure MySQL to listen on network interfaces and open firewall ports to allow remote client access to the database server.
Procedure
Edit the
mysqldsection of the/etc/my.cnf.d/mysql-server.cnffile. You can set the following configuration directives:bind-address- is the address on which the server listens. Possible options are:- a host name
- an IPv4 address
- an IPv6 address
skip-networking- controls whether the server listens for TCP/IP connections. Possible values are:- 0 - to listen for all clients
- 1 - to listen for local clients only
-
port- the port on which MySQL listens for TCP/IP connections.
To ensure that clients can access the database server on the network, open the port in the firewall:
# firewall-cmd --permanent --add-service=mysql # firewall-cmd --reloadRestart the
mysqldservice:# systemctl restart mysqld.service