The MySQL database cannot be accessed remotely by a workaround

Source: Internet
Author: User

What do I do if the MySQL database does not allow remote access?

Here are two ways to do this:

1. Table-changing method

MySQL account does not allow remote login, only on localhost. This time, as long as the computer on the localhost, log in to MySQL, the "MySQL" Database in the "User" table "host", from "localhost" renamed "%" can be.

 #mysql - u root - ppwd // mysql root password #mysql  >  Span style= "color: #0000ff;" >use   MySQL; #mysql  >  update  user  set  host =   " %    

2. Authorization Law

If you want users to use USERPWD to connect to the MySQL server from any host:

 #mysql >  grant  all  privileges  on  *. *  to    user   " @"  %    Identified by   userpwd    with  grant  option ; 
#mysql >flush rivileges;

 #mysql >  grant  all  privileges  on  *. *  to    user   " @"  192.168.32.220   " identified by   '  userpwd   '  


  

The MySQL database cannot be accessed remotely by a workaround

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.