This article will guide you through enabling remote access to the MySQL server using the Windows command prompt. However, you can also perform the same steps with MySQL command-line client or phpMyAdmin.
1. Open the command prompt. (Press Start + R, type cmd in the Run box, and hit Enter)
At the command prompt, navigate to path C:\Program Files\MySQL\MySQL Server 5.X\bin and run the following command. It will prompt you for the password of the MySQL root user. Enter the password, and the MySQL prompt will be displayed.
mysql -u root -p
3. At the MySQL prompt, create a remote user account with root privileges, and run the following commands.
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD';
- USERNAME: Username you wish to connect to the MySQL server.
- IP: Public IP address from where you wish to allow access to MySQL server.
- PASSWORD: Password of the username used.
IP can be replaced with % to allow users to connect from any IP address.
4. Flush the privileges by following the command and exit.
→ Looking for help on allowing Remote MySQL access on Linux Server? Please refer to allow remote MySQL for more details.