Saturday, July 5, 2014

Note about External Connections to a MySQL Instance Running on the Raspberry Pi

If you want to connect to a MySQL DB server instance running on a Raspberry Pi, a couple bits of additional configuration are required.  

On the Raspberry Pi, use nano or another text editor to edit the /etc/mysql/my.conf file.  Under the [mysqld] section, edit the bind-address to match the RPi's IP address, if you wish to restrict access to one IP interface's address or set it to 0.0.0.0 to all access using the IP address for any available network interface.

To allow remote access via the MySQL root login, (re)run the mysql_secure_installation script and answer the relevant question about remote access for root appropriately.  The following MySQL command (issued at the MySQL command line) has the same effect.  Change the password as appropriate.

 grant all privileges on *.* to 'root'@'%' identified by 'MyRootPassword' with grant option;



No comments:

Post a Comment