Add remote access to MySQL server

Posted on 07.10.16   CLI Database Linux MySQL SysAdmin

Follow the commands below to setup a new user and open up for remote access to a specific database on your MySQL server.

$ mysql -u root -p
    Enter your MySQL root password.
mysql> CREATE USER 'itdb_admin';
mysql> CREATE DATABASE itdb_db;
mysql> GRANT ALL PRIVILEGES ON itdb_db.* to 'itdb_admin'@'%' IDENTIFIED BY 'my-password' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
$ sudo nano /etc/mysql/my.cnf
    Comment the following line (to disable it):
    bind-address        = 127.0.0.1
$ sudo service mysql restart

Quick summary:

1) Open the MySQL CLI
2) Create a new database
3) Create a new user
4) Give the user full access to the database. Notice the '%' which means we’re talking about remote access. The same user can have different access levels based on the connection (whether it’s remote or local)
5) Flush/refresh the privileges so they become active
6) Disable bind-address so the MySQL server will listen on any source address
7) Restart the MySQL service to reload the config file

More on ITDB

Managing WiFi profiles in Windows 10


How to debug a non starting application with ProcMon


Turn off CTRL + ALT + DEL at login prompt Windows 10


Telnet alternative to check if port is open on host


Create a cmd alias/shortcut for issuing commands on remote computer




  1. We absolutely love your blog and find almost all of your
    post’s to be just what I’m looking for. Does one
    offer guest writers to write content to suit your needs?

    I wouldn’t mind composing a post or elaborating
    on some of the subjects you write about here.
    Again, awesome web site!