Mysql settings allow Internet access, mysql allows Internet access

Source: Internet
Author: User

Mysql settings allow Internet access, mysql allows Internet access

1) Open mysql.exe (MySQL Command Line Client) and enter the password

2. Input: use mysql;

3. query host input: select user, host from user;

4. Create a host (skip this step if the host value "%" exists)

If the host value "%" does not exist, execute the following two sentences:
Mysql> update user set host = '%' where user = 'root ';
Mysql> flush privileges;

5. Authorized Users

(1) Any host is connected to the mysql server with the user root and password pwd

Mysql> grant all privileges on *. * TO 'root' @ '%' identified by 'pwd' with grant option;
Mysql> flush privileges;

(2) The host with the specified IP address (for example, 192.168.1.100) is connected to the mysql server with the user tuser and password tpwd.

Mysql> grant all privileges on *. * TO 'tuser' @ '192. 168.1.100 'identified BY 'tpwd' with grant option;
Mysql> flush privileges;

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.