Xampp mysql 127.0.0.1 connection refused but localhost worked
Mac xampp mysql 127.0.0.1 connection refused but localhost worked
mysql配置:'hostname' => 'localhost'
1.hostname为 localhost 使用的unix socket 连接socket = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
,但是修改为127.0.0.1使用3306端口,走的是http协议。
2.查看端口号:
mysql> show global variables like 'port';
3.端口号错误,修改端口号,但是发现端口号在my.cnf中3306没错,后来发现:
SHOW VARIABLES LIKE 'skip_networking';
4.skip_networking = ON 被打开了,代表不开启网络远程连接,所以需要注释掉my.cnf中的 skip_networking ,这个是老版的做法,新版是注释掉bind-address = <some ip-address>
绑定IP的设置
5.kill 掉mysqld的进程,重启mysql
6.问题解决
相关推荐
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11
世樹 2020-11-11