Enable Mysql remote access _ MySQL

Source: Internet
Author: User
Enable Mysql remote access to bitsCN.com

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 '123 ';

Grant all on sonardb. * to sonar @ localhost identified by '20140901 ';

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.

BitsCN.com

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.