Enabling Mysql Remote Access

Source: Internet
Author: User

By default, Mysql cannot be accessed through a remote machine. You can enable remote access through the following configuration.

My Mysql environment is ubuntu + mysql5

1. Modify/etc/mysql/my. conf, bind-address, and specify as the actual IP address of the Local Machine. After modifying your my. con, it looks like the following:


[Mysqld]
#
# * Basic Settings
#
Default-character-set = utf8
Default-storage-engine = INNODB
Bind-address = 192.168.1.107
User = mysql
Pid-file =/var/run/mysqld. pid
Socket =/var/run/mysqld. sock
Port = 3306
Basedir =/usr
Datadir =/var/lib/mysql
Tmpdir =/tmp
Language =/usr/share/mysql/english
Skip-external-locking


2. log on to mysql using root and execute the following command:


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


Sonardb replaces the name of the database you want to access. sonar is the username you want to use, and 123456 is replaced with your password. This enables remote access.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.