How to Set mysql to allow remote access

Source: Internet
Author: User
Tags mysql gui
The vagran environment is configured, and the code is written to the host. It is really convenient to test the workflow in guest, but the problem arises immediately. Every time you want to view the content in mysql, you also need to log on to guest and view it through the command line. Some students raised their hands and said that you can install phpmyadmin and view it through the browser. This is indeed a good method, but it is always a kind of non-phper for me.

The vagran environment is configured, and the code is written to the host. It is really convenient to test the workflow in guest, but the problem arises immediately. Every time you want to view the content in mysql, you also need to log on to guest and view it through the command line. Some students raised their hands and said that you can install phpmyadmin and view it through the browser. This is indeed a good method, but it is always a kind of non-phper for me.

The vagran environment is configured, and the code is written to the host. It is really convenient to test the workflow in guest, but the problem arises immediately. Every time you want to view the content in mysql, you also need to log on to guest and view it through the command line. Some students raised their hands and said that you can install phpmyadmin and view it through a browser. This is indeed a good method, but it is not a phper for me, I always feel that it is cumbersome to install a php environment to view mysql. In fact, there are still some elegant solutions, that is, using the mysql GUI client to directly view the mysql In the guest, GUI client, I am using Sequl pro (mysql visualization client is the best in Mac environment ). The guest host uses Ubuntu 14.04 as follows:

First, ensure that mysql can belocalhostOther hosts need to be configured heremy.confFilebind-address = 0.0.0.0And then restart the mysql service.sudo service mysql restartAnd then configure the permissions of the current mysql account in two ways:

  • Modify the user table of myql and set the host entry fromlocalhostChange%

Mysql-uroot-p # Enter mysqlmysql> use mysql # Enter mysql database mysql> update usre set host = '%' where user = 'root' # modify mysql> select host user from user; # view the Modification result

  • By executing the authorization command, the principle is the same as above, that is, adding the host address that is allowed to access

GRANT ALL PRIVILEGES ON *.* TO root@my_ip IDENTIFIED BY ‘root_password‘ WITH GRANT OPTION;

Note thatmy_ipYou can enter the host address or a wildcard address.'%'

After completing the preceding two steps, you can directly access the mysql data in guest through the host machine.

-End-

This article from: http://freshstu.com, original address: http://freshstu.com/2014/12/how-to-access-remote-mysql/, thanks to the original author to share.

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.