How To Enable Remote MySQL Access In Ubuntu Linux

Advertisement

MySQL by default allows you to connect to it via localhost, you can not connect and make changes to it by directly connecting from some remote IP address. But it is a very common task, you often need to enable remote mysql access in order to access mysql server remotely.

Enabling remote mysql access is very simple, we just need to perform a little editing in the mysql configuration file. Open the /etc/mysql/my.cnf file by running the following command:

gedit /etc/mysql/my.cnf

Now change the bind- address entry to your IP address.

Once done with the change, enter into mysql from localhost and run the following command:

grant all on *.* to adminm@’%’ identified by ‘123456’

The above command needs some explanation, *.* means that you will be able to access all databases remotely, admin means that you will be able to access mysql via the admin user, and identified by ‘123456’ means that the admin user will use 123456 as a password to authenticate.

Advertisement
  • Nirm

    Awesome post, I wonder why you guys are not writing on Linux now a days ?

  • Wow, this is one of the only few examples out there that describes the process with screenshots.
    Nice work.

  • Wow, this is one of the only few examples out there that describes the process with screenshots.
    Nice work.

    • That’s what we specialize in at AddictiveTips! Stay Addicted!

    • That’s what we specialize in at AddictiveTips! Stay Addicted!