How to Set mysql remote access and firewall settings

Source: Internet
Author: User

In a real project, I need MYSQL remote access.

Scenario: After Mysql is installed, local access is normal. It is strange that local machines cannot access the MYSQL database on this server.

Search for information

By default, Mysql cannot be accessed from a remote machine. You can enable remote access through the following configuration.

On the MySQL Server:

Log on to MYSQL.. bin \ mysql-h localhost-u root-p

Prompt you to enter the password, enter the password

 

Mysql command mode,

Mysql> use mysql;
Mysql> grant all on *. * TO admin @ '%' identified by 'admin' with grant option;
# Allow any IP address (% above) to access the MySQL Server using the admin account and password (admin ).
# You must add an account like this to log on remotely. The root account cannot be remotely logged on. You can only log on locally.

 

On the server, IP addresses and new users can indeed access the server, but remote machines still cannot access the MYSQL.

By disabling the firewall on the server, you can access MYSQL. However, From the security perspective, you cannot disable the firewall.

 

Solution:

1. Open the firewall on the control panel and create a new rule in the rule.

2. Select the port and then click Next.

3. select TCP port, enter 80, port number, and press next

4. Select allow all connections

5. Select all next steps.

See http://maximumpcguides.com/windows-7/open-a-port-in-windows-7s-firewall/ for examples

 

Now you can remotely access your MYSQL data with a new user.

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.