Home >Database >Mysql Tutorial >How to Allow Remote MySQL Access from Any IP Address?
Granting Remote Access to MySQL Database from Any IP Address
To grant remote access to a MySQL database, the GRANT command can be utilized. However, if the intention is to allow any remote host to access the database, a slight modification is necessary to the syntax provided in the reference.
By replacing 'yourremotehost' with '%', the command becomes:
GRANT ALL PRIVILEGES ON database.* TO 'user'@'%' IDENTIFIED BY 'newpassword';
The wildcard character '%' represents all IP addresses. This permits any host to establish a connection and access the specified database. It's crucial to remember that granting such broad access should only be considered if security measures are in place to safeguard the database against unauthorized use.
The above is the detailed content of How to Allow Remote MySQL Access from Any IP Address?. For more information, please follow other related articles on the PHP Chinese website!