在命令行使用 mysql -u grafana -p -h ip 发现一直连接不成功,后面发现本机和目标机都有在运行mysql的实例,但是本机设置的端口和要连接的机器的端口不同
mysql -u grafana -p -h ip
解决方案,添加端口参数 mysql -u grafana -p -h ip -P 3306 然后就连接成功了
mysql -u grafana -p -h ip -P 3306