在使用MySQL数据库时,有时候我们需要将实例地址更换,这个过程并不难,以下是具体步骤:
shell>vi /etc/mysql/my.cnf# Commenr out bind-address from mysqld section and add new one#bind-address = 127.0.0.1bind-address = 0.0.0.0
在编辑器中打开my.cnf文件,找到mysqld部分的bind-address行,注释掉原来的地址,并添加新的地址,保存并关闭编辑器。
shell>sudo systemctl restart mysql.service
接下来,重启MySQL服务,使新的地址将生效。