1,远程链接Ubuntu 22.04 mysql时,可能会出现无法连接的情况,解决办法:
- 创建mysql用户且授权
create user ‘root’@‘%’ IDENTIFIED WITH mysql_native_password BY ‘1234’;
grant all on *.* to ‘root’@‘%’;
- 关闭ubuntu防火墙,且关闭自启
systemctl stop firewalld
systemctl disable firewalld
- 修改mysql配置文件
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
注释下图红框内容