root@ubuntu:~# apt install mysql-server-8.0 mysql-client-8.0
修改 /etc/mysql/mysql.conf.d/mysqld.conf
第 31 行左右的 bind-address = *
命令行下键入 mysql
mysql> update mysql.user set host='%' where user='root';
mysql> select user,host from mysql.user;
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'mysql123!ROOT';
mysql> flush privileges;
第一行用来修改 root 可远程访问
第二行用来查看是否修改成功
第三行修改 root 密码
第四行刷新配置
root@ubuntu:~# systemctl restart mysql
查看 mysql8 下的密码验证策略
mysql> show variables like '%validate_password%';
查看 mysql 的绑定地址
mysql> show variables like '%bind_address%';
https://blog.csdn.net/LB_AUTO/article/details/106041858
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html