本机ip绑定
1. 修改/etc/mysql/mysql.conf.d/mysqld.cnf
2. 设置bind-address = 10.100.2.1793. mysql -u root -p[passwd];
4. use mysql;
5. grant all privileges on *.* to root@'%' identified by 'passwd';
成功则显示如下:
root@XXX:/opt/apache-tomcat-9.0.0.M26/webapps# netstat -tanp | grep mysql
tcp 0 0 10.100.2.179:3306 0.0.0.0:* LISTEN 7613/mysqld