配置远程连接MySQL数据库

原创作品,出自“深蓝的blog”博客,欢迎转载,转载时请务必注明以下出处,否则追究版权法律责任。深蓝的blog: 使用mysql远程连接软件(MySQL-Front),远程连接报错: [root@master~]#mysql-uroot@localhostWelcometotheMySQLmonitor. Commandsendwith;o

大家好,又见面了,我是你们的朋友全栈君。

原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明以下出处,否则追究版权法律责任。

深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/44086869

 

使用mysql远程连接软件(MySQL-Front),远程连接报错:

配置远程连接MySQL数据库

 

[root@master ~]# mysql -u root@localhost

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) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

 

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

affiliates. Other names may be trademarks of their respective

owners.

 

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

 

mysql>quit

 

解决远程无法连接:

[root@master ~]# 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) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

 

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

affiliates. Other names may be 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

You can turn off this feature to get a quicker startup with -A

 

Database changed

mysql> select user,password,host from user;

需要将远程访问主机的IP添加进去

+——+——————————————-+—————–+

| 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 root@”10.53.105.221″ identified by “root”;

赋予IP地址为10.53.105.221主机拥有所有权限(其中包括远程访问、远程操作权限)

Query OK, 0 rows affected (0.04 sec)

mysql> flush privileges;

重新加载权限设置

Query OK, 0 rows affected (0.05 sec)

mysql> select user,password,host from user;

再次查询,IP10.53.105.221主机已经添加到host文件中

+——+——————————————-+—————–+

| 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)

 

再次远程登陆,成功连接了,如下图:

配置远程连接MySQL数据库

 

原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明以下出处,否则追究版权法律责任。

深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/44086869

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/128300.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 必须了解的MySQL三种日志

    必须了解的MySQL三种日志

    2022年2月18日
    78
  • typedef int ElemType

    typedef int ElemType1  typedefintElemType;为什么呀,我倒是知道后面用ElemType定义别的数据类型,看起来是把ElemType和int一样啦,那直接用int不用行了,为什么要用ElemType.这是定义一个线性表元素类型的最佳答案定义不同的数据类型名称是为了程序的可读性.而且一旦你需要将类型变换比如使用double型的了,只要写:typedefd

    2022年5月12日
    40
  • 43、java.beans.PropertyDescriptor类

    43、java.beans.PropertyDescriptor类一、软件包java.beans    包含与开发beans有关的类,即基于JavaBeansTM架构的组件 二、PropertyDescriptor   PropertyDescriptor描述JavaBean通过一对存储器方法导出的一个属性 publicclassPropertyDescriptorextendsFeature…

    2022年9月27日
    0
  • 数据管理

    数据管理

    2021年8月29日
    70
  • 常见的基本汇编书籍有哪些_简单点的汇编书籍

    常见的基本汇编书籍有哪些_简单点的汇编书籍Windows.环境下32位汇编语言程序设计(第2版) http://www.happycampus.cn/docs/957100583237@hc10/275980/ 汇编语言编程艺术 Intel汇编语言程序设计(第四版) Intel汇编语言程序设计(第五版)范例 http://download.csdn.net/source/1523425 

    2022年10月13日
    1
  • python实现udp_python udp报文解析

    python实现udp_python udp报文解析python的udp攻击ddos攻击upd攻击主要是运用,网络套接字模块和多线程或多进程模块对一个ip不断的发送数据包,代码中都是都是自带库python可直接运行和调用。使用前请注意!!!!!!!!!!!!!!!!!!!!!未成年人请勿使用!!!!!!!!!!!!!!!!!!!请勿非法攻击任何网络!!!!!!!!!!!!!!!!!刑法里涉及计算机犯罪的在第285、286、287条,请自行查阅#coding=’utf-8’importsocket#套接字模块fromthreadingim

    2022年10月3日
    0

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号