Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change mysql listening (bind) address on windows

Tags:

mysql

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?

like image 312
Jan Avatar asked Nov 02 '25 08:11

Jan


1 Answers

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]
like image 59
Thierry Brémard Avatar answered Nov 05 '25 06:11

Thierry Brémard