1. Change mysql config
Find the mysql config file
/etc/mysql/my.cnf
OR (if above file points to !includedir /etc/mysql/mysql.conf.d/)
/etc/mysql/mysql.conf.d/mysqld.cnf
Comment out following lines (IF ANY)
#bind-address = 127.0.0.1
This allows outside connections other than localhost (127.0.0.1)
#skip-networking
This allow listening of TCP/IP ports
2. Change GRANT privilege
mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%'
IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
Following ensures that user has access to all schemas in the database
*.*
% ensures that user can connect from any IP address / Network
'USERNAME'@'%'
Then run this command to apply the changes.
mysql> FLUSH PRIVILEGES;
3. Restart MySQL server
Restart the server
service mysql restart
4. Connect to server
Default port for MySQL is
3306
You can also find the port that it's running using this command
netstat -tln
It should return something like this
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
In MySQL Workbench
Use the SQL Server's IP address as Host name
Use 3306 as Port Number
Use the User that you granted access to
Use 'password' that you used in the GRANT command
Please refer to https://easyengine.io/tutorials/mysql/remote-access/