How to Enable Remote MySQL Connectivity
Introduction
Remote connectivity to MySQL allows external sources to establish connections with your local database. By default, remote connections are disabled, particularly for root users. This article provides a detailed solution to enable remote MySQL connections.
How to Enable Remote Connections
1. Grant Access for Remote Users
Execute the following SQL command locally:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
Run this command:
FLUSH PRIVILEGES;
2. Edit my.cnf File
Find the line:
bind-address = 127.0.0.1
Comment it out by adding a "#" at the beginning of the line:
#bind-address = 127.0.0.1
3. Restart MySQL Server
The above is the detailed content of How to Allow Remote Connections to My MySQL Database?. For more information, please follow other related articles on the PHP Chinese website!