How to remotely connect to the MySQL server

tag - How do you enable remote connection to MySQL?

(1) Open cmd.

(2) Navigate to the path C: \ Program Files \ MySQL \ MySQL Server 5.X \ bin and run this command.

mysql -u root -p

(3) Enter the root password.

(4) Run the following command to provide permission.

GRANT ALL PRIVILEGES .TO 'USERNAME' @ 'IP' IDENTIFIED BY 'PASSWORD';

USERNAME: Username that you want to connect to the MySQL server.

IP: Public IP address from which you want to allow access to the MySQL server.

PASSWORD: Password of the username used.

IP can be replaced with% so that the user can connect from any IP address.

(5) Empty the foresails by following the command and exiting the command.

FLUSH PRIVILEGES;

Exit;