vim /etc/mysql/mysql.conf.d/mysqld.cnf
# If MySQL is running as a replication slave, this should be
# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir
# tmpdir = /tmp
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# default value 127.0.0.1
#bind-address = 127.0.0.1
# edit it, 修改为0.0.0.0
bind-address = 0.0.0.0