MySQL database can be accessed using any ip address.

Source: Internet
Author: User

MySQL database can be accessed using any ip address.

Use the CMD command line to modify the value of a field in the database table for connection and access.

Step 1. Find the bin directory where the MYSQL software is installed;

(1) cd \ Current Directory


(2) Specify the bin directory for MYSQL Installation


(3) Enter-h localhost-u root-p. The password is displayed. Enter the password you set when installing the MYSQL software.


(4) Enter use mysql; select user, host from user; our goal is to replace localhost with %.

(5) use the update user set host = '%' where host = 'localhost'; statement to update.


(6) It will be OK if it is changed to this format.


Enter the preceding statement to query the result as follows:


In this case, MYSQL can be accessed using any IP address.



How can I grant a remote IP address access permission to a MYSQL database?

Your MYSQL database contains a database named mysql, which contains a table named user. You can check the structure and existing data of the table, you will know what to do. For example, you can add a piece of data, and the IP address specified by the Host for you, the user can be %, and the password doesn't matter, the corresponding permissions (all can be Y) are set later, so that the machine can connect to the database regardless of the user and password, and has the permissions you specified.

Be patient. I believe you will understand it at a glance.
Reference: blog.chinaunix.net/u2/73743/showart_1094545.html

How can I allow a fixed ip address to connect to the mysql database?

Use the grant statement to allocate the desired fixed address... for example, mysql> grant all on db. * to user @ 'IP' identified by 'pwd ';
 

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.