MySQL Open remote login (modify data table and authorization two methods)

Source: Internet
Author: User

First, confirm that the firewall does not block port 3306 (the general server will be blocked by default)

Windows Firewall Exception Setting method

Control Panel (select View as large icon in upper right corner)---Firewall---Advanced settings---Advanced settings---Outbound rules---Right-most new rule New Outbound Rule Wizard, in the first step of the wizard, select the type of firewall rule you want to create, and select the second port.

Windows Firewall Add Port method

Windows Firewall has made larger upgrade settings that have been divided into inbound and outbound. Control Panel \ All Control Panel items \ Windows Firewall entry

Inbound rule Settings
The first step is to select the inbound rule and then create a new rule, select the port, and then next

The second step is to select TCP to select a specific port and then enter the port, where multiple ports need to be separated by commas for example: 3306,8080

Step three, select Allow connection

Fourth Step select the scope of the application rule

Fifth Step enter the rule name

Outbound Rule Settings
The first step is to select the inbound rule and then create a new rule, select the port, and then next
The second step is to select TCP to select a specific port and then enter the port, where multiple ports need to be separated by commas for example: 3306,8080
Step three, select Allow connection

Fourth Step select the scope of the application rule

Fifth Step enter the rule name


At this point, the firewall rules are set and enabled!
In addition to the Win7 IIS7, simply enable inbound rules: BranchCache content Retrieval (http-in)
Outbound rules: BranchCache content Retrieval (http-out).

Second, set up MySQL allows users to connect remotely (there are two types of operation)

1. Authorization Rights (recommended)

Allow the root user to remotely log in anywhere and have any permissions to operate on any library, as follows:

In this machine first use root user login mysql:mysql-u root-p "Youpassword" for authorization operation:

Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' Youpassword ' with GRANT OPTION;

Overload Authorization Table: Mysql>flush privileges;

Exit MySQL Database: mysql>exit

Allow the root user to remotely log on to a specific IP and have any permissions for any library operations, as follows:

First Use root user login mysql:mysql-u root-p "Youpassword" on the Machine

Authorization action: Grant all privileges on * * to [email protected]"192.168.xx.xxx" identified by "Youpassword" with Grant O ption;

Overload Authorization Table: FLUSH privileges;

Exit MySQL Database: Exit

To remove user authorization, you need to use the REVOKE command in the following format: REVOKE privileges on database [. Table name] from User-name; Specific example, first in the native login mysql:mysql-u root-p "Youpassword" for authorization operation: Grant Select,insert,update,delete on test-db to [email protect Ed]"192.168.xx.xxx identified by" Youpassword "; Then delete authorization operation: REVOKE all on test-db from Test-user; Note: This action only clears the user's authorization rights for TEST-DB, but this "test-user" user still exists. Finally clear the user from the user table: DELETE from user WHERE user= "Test-user"; Overload Authorization Table: FLUSH privileges; Exit MySQL Database: Exit

2. Modify the Data sheet

Log in to MySQL locally and change the "host" entry in the "User" table in the "MySQL" database, changing "localhost" to "%"

#mysql-U root-proot
Mysql>use MySQL;
Mysql>update User Set host = '% ' where user = ' root ';
Mysql>select host, user from user;

Run on the machine where MySQL is installed:

12345678 enter MySQL server d:\mysql\bin\>mysql-h localhost-u root give any host access to data MYSQL> GRANT ALL PRIVILEGES ON *.* TO ' root ' @ ‘%‘ WITH GRANT option Make the changes effective mysql>flush privileges quit MySQL server mysql>EXIT

MySQL Open remote login (modify data table and authorization two methods)

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