Home  >  Article  >  Database  >  How to solve the problem of changing the binding IP of kali virtual machine mysql

How to solve the problem of changing the binding IP of kali virtual machine mysql

WBOY
WBOYforward
2023-05-28 15:13:111203browse

Modify binding ip

Possible reasons

This is what happened: I installed Kali, then installed MySQL (mariadb), initialized the account password, but tried to log in remotely and failed. . . . Attempting to remotely log in to mysql failed, so Baidu must set up how to allow remote login. . . Because the firewall is closed, the remote login attempt fails. It is recommended to learn relevant knowledge through Baidu. . . If you don't understand, you can try to start the mysql service through Baidu and log in remotely, but the attempt fails. . . If I don’t understand, I checked a lot of methods on Baidu. Most of them are to solve network problems, but they can’t solve my problem. My host machine and kali network can ping each other, and kali can also access the Internet normally, so his network is definitely good. In the end , a post mentioned that port 3306 has always been bound to the 127.0.0.1 address, resulting in inability to access the bound address. It suddenly dawned on me

How to solve the problem of changing the binding IP of kali virtual machine mysql

##If you don’t understand, just Baidu—— ;It’s all about how to modify IP in ubantu and centos. Modify mysql.cnf. This file in kali does not have the bind-address field. There is no change if you write it directly.

Modify the mysql binding address in kali

Finally I saw a post, what was modified was mysqld.cnf in mysql.conf.d. I thought that mysql was mariadb, so I entered the /etc/mysql/mariadb.conf.d/ directory and found it. There are some configuration files

How to solve the problem of changing the binding IP of kali virtual machine mysql

#I feel that the truth is here, so I checked the files one by one, and sure enough I found the bind-address field in the file 50-server.cnf. Try Modified it

vim /etc/mysql/mariadb.conf.d/50-server.cnf #找到bind-address = 127.0.0.1 修改未0.0.0.0或者注释掉

Restart the service

systemctl restart mysql

View port

netstat -autlnp

How to solve the problem of changing the binding IP of kali virtual machine mysql

It feels good, 3306 is bound to 0.0.0.0 , the host navicat is finally connected! ! !

The above is the detailed content of How to solve the problem of changing the binding IP of kali virtual machine mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete