注意 修改配置文件 sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 将文件中的bind-address=127.0.0.1注释掉,在这行语句前面加 # 即为注释 密码认证方式 select host,user,plugin from user; alter user ‘root’@‘%’ identified with mysql_native_password by ‘密码’