Enable Remote Access to Mysql database in Ubuntu Linux

This post was written by admin on October 26, 2009
Posted Under: General

By default,remote access to mysql database is disabled in ubuntu.Following is how to enable this in ubuntu+mysql5.
1.Edit etc/mysql/my.cnf:

sudo gedit /etc/mysql/my.cnf

change bind-address to your IP address,make it look like this:

[mysqld]
#
# * Basic Settings
#
default-character-set=utf8
default-storage-engine=INNODB

bind-address    = 192.168.1.107

user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
language        = /usr/share/mysql/english
skip-external-locking

2.Log in mysql with root user and run:

grant all on sonardb.* to sonar@'%' identified by '123456';
grant all on sonardb.* to sonar@localhost identified by '123456';

Change “sonardb” to the database_name your want to remote access to.”sonar” is the user_name,and ’123456′is the password.

Related posts:

  1. Fix Mysql5.0 ERROR 1045(forget database password) in Ubuntu Linux
  2. Access remote Ubuntu using Shellinabox,A Web Based Terminal Emulator
  3. Enable remote desktop in Virtual machine(Virtualbox guest)
  4. Install and Enable Telnet server in Ubuntu Linux
  5. An Easy way to mount remote filesystem on ubuntu

    Add a Comment

    required, use real name
    required, will not be published
    optional, your blog address