第一步,需要配置文件
shell /etc/mysql/mysql.conf.d/mysqld.cnfshell bind-address = 127.0.0.1shell bind-address = xxx.xxx.xxx.xxx第二步,需要新建一个可供远程连接的管理员用户,root 用户是不允许被远程直接访问到的
shell mysql -uroot -pshell CREATE USER ‘username‘@‘localhost‘ IDENTIFIED BY ‘password‘;shell GRANT ALL PRIVILEGES ON *.* TO ‘username‘@‘localhost‘ WITH GRANT OPTION;shell CREATE USER ‘username‘@‘%‘ IDENTIFIED BY ‘password‘;shell GRANT ALL PRIVILEGES ON *.* TO ‘username‘@‘%‘ WITH GRANT OPTION;shell FLUSH PRIVILEGES;原文:https://www.cnblogs.com/dyungwang/p/9641588.html