Configure remote connection MySQL database

Source: Internet
Author: User
Tags reserved

Original works, from the "Blue Blog" blog, Welcome to reprint, please be sure to indicate the following sources, otherwise, the legal responsibility to pursue copyright.

Deep Blue Blog: http://blog.csdn.net/huangyanlong/article/details/44086869

Using MySQL remote connection software (mysql-front), Remote connection error:

[Email protected] ~]# mysql-u [email protected]

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 8

Server version:5.1.66 Source Distribution

Copyright (c), Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

Mysql>quit

To resolve a remote unreachable connection:

[Email protected] ~]# mysql-u root-p

Enter Password:

Welcome to the MySQL Monitor. Commands End With; or \g.

Your MySQL Connection ID is 11

Server version:5.1.66 Source Distribution

Copyright (c), Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its

Affiliates. Other names trademarks of their respective

Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

mysql> use MySQL;

Reading table information for completion of table and column names

Can turn off this feature to get a quicker startup with-a

Database changed

Mysql> select User,password,host from user;

-- The remote access host needs to be IP Add in

+------+-------------------------------------------+-----------------+

| user | password | Host |

+------+-------------------------------------------+-----------------+

| Root | *81f5e21e35407d884a6cd4a731aebfb6af209e1b | localhost |

| Root | *d997577481b722a2996b58bce11ef3c312ac0b89 | Master.cloudera |

|                                           Root | | 127.0.0.1 |

|                                           | | localhost |

|                                           | | Master.cloudera |

+------+-------------------------------------------+-----------------+

5 rows in Set (0.00 sec)

Mysql> Grant all privileges on * * to [email protected] ' 10.53.105.221 ' identified by ' root ';

-- Give IP address is 10.53.105.221 host has all permissions (including remote access, remote operations permissions)

Query OK, 0 rows affected (0.04 sec)

mysql> flush Privileges;

-- Reload permission Settings

Query OK, 0 rows affected (0.05 sec)

Mysql> select User,password,host from user;

-- query again, IP to be 10.53.105.221 the host has been added to the Host in the file

+------+-------------------------------------------+-----------------+

| user | password | Host |

+------+-------------------------------------------+-----------------+

| Root | *81f5e21e35407d884a6cd4a731aebfb6af209e1b | localhost |

| Root | *d997577481b722a2996b58bce11ef3c312ac0b89 | Master.cloudera |

|                                           Root | | 127.0.0.1 |

|                                           | | localhost |

|                                           | | Master.cloudera |

| Root | *81f5e21e35407d884a6cd4a731aebfb6af209e1b | 10.53.105.221 |

+------+-------------------------------------------+-----------------+

6 rows in Set (0.00 sec)

Remote login again, successfully connected, such as:

Original works, from the "Blue Blog" blog, Welcome to reprint, please be sure to indicate the following sources, otherwise, the legal responsibility to pursue copyright.

Deep Blue Blog: http://blog.csdn.net/huangyanlong/article/details/44086869

Configure remote connection MySQL database

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.