MySQL 5.7 Remote Connection

Source: Internet
Author: User

The Ubuntu virtual machine is installed in the VirtualBox and then the MySQL Community server (GPL)in Ubuntu, version 5.7.18, wants to connect to MySQL server from outside (host).

Because the network mode of the Ubuntu virtual machine is "NAT Network", first map the host's 3306 port to the 3306 port of Ubuntu virtual machine in VirtualBox;

Then installed in the host MySQL Workbench, with root login MySQL server is unsuccessful, view the online solution, found that need to modify two places in Ubuntu virtual machine:

    • Comment out or modify the bind_address line in/etc/mysql/my.cnf to "bind_address=":

On my system,bind_address is not in the/etc/mysql/my.cnf file , this file removes the comment only the following two lines of content:



Based on this content, you should look at the. cnf file in both/etc/mysql/conf.d/and/etc/mysql/mysql.conf.d/folders, and Discover/etc/mysql/mysql.conf.d/ The mysqld.cnf file is configured with "bind_address=" and commented out.

(if this item is not set, MySQL Workbench indicates that the connection was unsuccessful:)

    • the host domain of the relevant user (for example, root) in the Mysql.user table can be modified to a specific IP address, or "%" as a wildcard (for example, "%" on behalf of any address):UPDATE user SET host= '% ' WHERE User= ' root '.

(if this item is not set, MySQL Workbench prompt Access Denied:)

 Also, if you add "bind_address=" directly to the/etc/mysql/my.cnf file, the bind_address in the/etc/mysql/will be overwritten, depending on the comment in the file and its existing content. The bind_address in the etc/mysql/my.cnf file.



MySQL 5.7 Remote Connection

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: 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.