于是组合关键字(树莓派 mysql)求百度问谷歌。未果。操刀自己来吧。检查mysql的配置文件 /etc/mysql/my.cnf 发现如下配置
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
到这里就什么都清楚了,大概意思是树莓派的mysql装完了之后默认只监听本地端口,要想远程访问的话就只要把127.0.0.1改成0.0.0.0就ok了。改完重启mysql,访问正常。