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 belocalhost
Other hosts need to be configured heremy.conf
Filebind-address = 0.0.0.0
And then restart the mysql service.sudo service mysql restart
And then configure the permissions of the current mysql account in two ways:
- Modify the user table of myql and set the host entry from
localhost
Change%
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_ip
You 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.