The MySQL server on the Pi is probably not listening on the network interface. For security reasons the default is listening on the loopback / local host / 127.0.0.1 interface only.
The common location of the MySQL configuration file is
/etc/mysql/my.cnf. If that contains a line
bind-address 127.0.0.1
comment that out or change it to
bind-address 0.0.0.0