By default, MySQL is not active for remote access. On this tutorial, we will show how to activate the remote access in Windows and Linux.
Windows
1. Open the MySQL command prompt
2. In the MySQL prompt , enter the following command line that grants all users and all IPs:
GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'password root';
- Note it is possible to give privileges to other users (modifying ‘root’) in a IP (modifying @’%’).
3. Now run the command FLUSH PRIVILEGES;
4. Allow MySQL port (ex: 3306) in your Firewall.
Linux
1. Open your terminal and login as root then run this command: nano etc/mysql/my.cnf
2. Alter the line bind-address = 127.0.0.1, to bind-address = 0.0.0.0
3. Restart MySQL Service, using /etc/init.d/mysql restart
4. Enter this command line mysql –u root –p
5. In the MySQL prompt , enter the following command line that grants all users and all IPs:
GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'password root';
- Note it is possible to give privileges to other users (modifying ‘root’) in a IP (modifying @’%’).
6. Allow MySQL port (ex: 3306) in your Firewall.
Caio Guerra (Migrated deleted Agent)
Comments
toribio nunez