ubuntu20 mysql8.0 更改默认密码
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123';
flush privileges;
quit;
编辑mysql配置文件,把其中bind-address = 127.0.0.1注释了
vi /etc/mysql/mysql.conf.d/mysqld.cnf
mysql –u root -p
mysql> use mysql;
mysql> update user set host = ‘%’ where user = ‘root’;
mysql> flush privileges;
/etc/init.d/mysql restart