Say, you’re going to do a “dump” and you don’t want remote clients to alter the current data…
Here’s a simple trick to deny access to remote clients temporarily.
1. open your MySQL configuration file, my.cnf (in CentOS / Red Hat, located in /etc/my.cnf)
2. add skip-networking flag under [mysqld], like this:
3. restart your MySQL server (in CentOS / Red Hat, run service mysqld restart)
4. Do a simple test to verify.
Note that this will affect remote clients only, local clients can still connect via Unix sockets.