When granting remote access to a MySQL database, the standard command typically specifies a specific IP address. However, if you wish to allow access from any remote host, a slight modification is required.
The revised command now grants privileges to a user with the wildcard '%' instead of a specific IP address:
GRANT ALL PRIVILEGES ON database.* TO 'user'@'%' IDENTIFIED BY 'newpassword';
By utilizing '%', the database is effectively made public, allowing access from any remote host. This character serves as a wildcard, enabling you to specify broader IP ranges or patterns, such as:
The above is the detailed content of How Can I Grant Remote MySQL Access from Any IP Address?. For more information, please follow other related articles on the PHP Chinese website!