How to enable remote access to a MySQL database

If you need to access your mysql database remotely, which I did, you can create a mysql user that has access locally, and remotely.

For example if you want to login and edit the database via HeidiSQL or other mysql tools.

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION; CREATE USER 'username'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' WITH GRANT OPTION;  

These commands will create a user called “username” with the password “password”, which has both local and remote access.

comments powered by Disqus