Remote use of MySQLGUI tool _ MySQL

Source: Internet
Author: User
Remote use of MySQLGUI tool mysqlGUI

Currently, most database-driven network applications use MySQL as the preferred database, so MySQL has applications on many network servers. Even though the MySQL command statement tool is very useful, if you are not familiar with the SQL syntax, it will take a lot of time to work. As a result, tools such as phpMyAdmin came into being.

MySQL developers developed their own GUI tools that can connect to local or remote MySQL databases. These tools include MySQL Administrator, MySQL Query Browser, and MySQL Workbench, they are all excellent graphical tools that can easily operate and create MySQL databases.

There is a problem when using these tools to operate remote databases. They often require MySQL to respond on the network interface. most MySQL administrators only allow MySQL to respond to localhost or socket, and reject remote connection. This is a very effective security measure, but in this case, these GUI tools cannot be remotely used without some means. In this case, using ssh to secretly connect is a very good method. In this way, not only strict authentication and encryption can be performed, but also the rules that only allow local connections of MySQL are not broken.

First, to make MySQL only respond to localhost (by default, MySQL only responds to requirements for local socket connection), you need to adjust the settings so that MySQL can allow network connection, and then restart the server. MySQL should only respond to connections on loopback or local and network interfaces. Then, edit ~ /. Ssh/config file, and insert the following content:

Host remotesql
? Hostname webserver.domain.com
? User joe
? LocalForward *: 13306 localhost: 3306

This will connect to webserver.domain.com as user joe, and push Port 13306 (standard MySQL Port) on the local system to webserver.domain.com ). Note that the push port is not restricted to the local interface of the local device, but to all interfaces. that is to say, we can connect to Port 13306 of me.domain.com (assuming me.domain.com is the name of the local workstation ), besides connecting to the local host port 13306 (this is very important because the GUI tool will try to connect to localhost through socket, which is not expected to happen ). Now you can run the following command to start the connection.

$ Ssh-f-N remotesql

Finally, start the MySQL manager and connect it to me.domain.com on port 13306 using your credit card. If an "access denied" error occurs, check the permission information on the remote database. User@localhost.localdomain may have to be licensed for the right connection.

In this case, you can establish a secure connection over the Internet through any system on the local network (unless the firewall rules prohibit the use of local devices, you can use the local MySQL command statement to perform specific operations on the remote database.

$ Mysql-u root-p-h me.domain.com-P 13306

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.