I'm using JDBC (inside of Google Apps Script) to connect to a remote MySQL server that I created on a Raspberry Pi (running Raspbian Lite), but I'm unable to establish a connection when I run this command: var conn = Jdbc.getConnection("jdbc:mysql://[Raspberry Pi's IP Address]:3306/[Database Name]", "username", "password");
Where "username" and "password" is the login info for my MySQL database.
I have followed the steps necessary for MySQL remote access suggested here. These include:
- Commenting out the bind-address from the
/etc/mysql/mariadb.conf.d/50-server.cnf
file. The common locations for the configuration file containing the bind-address value (e.g./etc/mysql/my.cnf
) didn't exist on the Raspberry Pi, so I ended up finding the file listed above. - Enabling remote root access to the MySQL database.
- And, using
telnet
on the Raspberry Pi. The message: "Connection closed by foreign host." occurs when I use it, however, and I'm unaware of what that message could mean.
What do you think is preventing a connection to the database from being established?