LOGO

Switch MySQL to TCP Listening - Configuration Guide

September 11, 2006
Switch MySQL to TCP Listening - Configuration Guide

Configuring MySQL for Remote Access

MySQL, by its default settings, restricts connections to originate only from the local machine. This is a security measure implemented during installation.

The primary configuration file governing MySQL's behavior is typically located at /etc/mysql/my.cnf. This file contains directives that control various aspects of the server.

Modifying the Bind Address

To enable remote connections, the bind-address directive within the configuration file must be adjusted. Specifically, it needs to be commented out.

Commenting out the line ensures that MySQL listens on all available network interfaces. This is achieved by prefixing the line with a hash symbol (#).

#bind-address     = 127.0.0.1

Restarting the MySQL Server

After modifying the configuration file, a restart of the MySQL server is essential for the changes to take effect.

The server can be restarted using the following command, which requires superuser privileges:

sudo /etc/init.d/mysql restart

Following these steps will allow connections to the MySQL server from remote hosts, provided appropriate user permissions are also configured.

#MySQL#TCP#configuration#networking#remote access#listen