Bind Address missing in my.cnf in MYSQL centos

I encountered a problem when I edit my.cnf for MySQL, the bind-address not in the file.

Here is the contents of /etc/mysql/my.cnf :

 [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid 

Please help me achieve this.

+6
source share
1 answer

Just add these lines to the mysqld section, depending on your preference:

  • If you want it to be accessible only through localhost:

    bind-address=127.0.0.1

  • If you want it to be accessible through the interface to which the IP address XXX.YYYY.WWW.ZZZZ has been assigned:

    bind-address=XXX.YYYY.WWW.ZZZZ

  • If you want it to be accessible through all available interfaces, this is not recommended , unless you have correctly configured your firewall for it:

    bind-address=0.0.0.0

+2
source

All Articles