Remotely connect to MYSQL database _ MySQL

Source: Internet
Author: User
Remote connection to MYSQL database bitsCN.com

Local environment:

System: Fedora 20 (Linux should be the same)

Mysql: 5.6.

Remote Environment:

System: windows XP (in virtual machine)

Navcate for mysql: 10.0.11

1. Local Configuration

After the local MYSQL environment is fully configured, you only need to authorize it.

First, make sure that your local firewall has opened Port 3306 to support external access.

Then, you authorize it in your mysql instance.

What table modification method and authorization method are available on the Internet.

This is what they call authorization:

Go to mysql

mysql>grant all privileges on *.* to zemo@10.0.2.15 identified by '123456';
In front of the zemo@10.0.2.15 is the user name, you can set the general is root, the second part is the remote IP address,

'000000' is undoubtedly the password.

Because I use a local virtual machine as a remote environment, the permission I grant is all.

You can also open some permissions.

mysql>grant select,insert,update,delete on mercy.* to zemo@10.0.2.15 identified by '123456';
This is a common addition, deletion, modification, and query function.

Permission range: all tables in mercy

Of course, common permissions include create, drop, reload, etc,

The younger brother has never been familiar with these permissions,

If no error is reported, you can query the following:

mysql> select host,user from user;
If the data you just set is successfully queried, execute the following statement to refresh:
mysql> flush privileges; 
2. remote configuration is the same as normal connection. my navicat

You can also use commands to connect (but make sure that at least myslq-client is installed in your remote environment)

You can execute the command:

mysql -u zemo -p123456 -h 192.168.2.100 -P 3306 -D mercy
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.