Enable Remote Access To MySQL under Linux

This is done under Ubuntu, but it almost the same for every version of Linux.


  1. Edit my.cnf File – you can find it with the locate command, usually under /etc/mysql/my.cnf.
  2. look for bind-address. found it? make sure this is indeed your server address on the network and not, lets say,…
  3. restart mysql (this is the exact command as well)
  4. Login to mysql from the terminal mysql -u root -p and then your password.
  5. create your db using create database command, e.g. create database test1;
  6. Now grant access to the user you want (this will create a user if not exists): GRANT ALL ON test1.* TO myuser@'' IDENTIFIED BY 'PASSWORD';
  7. if you want myuser to be able to connect from any IP, you can just type: GRANT ALL ON test1.* TO myuser IDENTIFIED BY 'PASSWORD';and it will work.

Leave a Reply

You must be logged in to post a comment.