平台:termux-app
服务器版本: 8.0.40-0ubuntu0.20.04.1

修改配置文件

默认在:/etc/mysql/mysql.conf.d/mysqld.cnf

bind-address改为0.0.0.0即可

执行一堆命令

mysql>use mysql;

mysql>select host from user where user='root';

mysql>update user set host = '%' where user ='root';

mysql>flush privileges;

修改用户认证方式和设置密码

mysql>ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'your_secure_password';
mysql>flush privileges;

最后

重启mysql服务即可

sudo service mysql restart