'change mysql listening (bind) address on windows

I'm using MySQL for Windows (installed through Oracle's official setup utility), and I don't want MySQL to accept connections that are NOT coming from a specific host (in this case it's a certain domain). Been using Linux before and thus I know that there was something about my.cnf where I simply had to change the bind-address value. However, I cannot find this file using Windows. Any tips for me?



Solution 1:[1]

with mysql 8 on windows 10, you can edit with admin privileges the file: my.ini in the directory: C:\ProgramData\MySQL\MySQL Server 8.0

remark: you can find this path via properties of service, as it is referenced in commandline: enter image description here

in section: [mysqld] set (it might not exist so add the line): bind_address=127.0.0.1

Restart windows service:

sc query MySQL80
sc stop MySQL80
sc start MySQL80

then check via netstat that binding adress

    netstat -abn

  TCP    127.0.0.1:3306        0.0.0.0:0              LISTENING
 [mysqld.exe]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1