配置远程连接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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Idea激活码最新教程2021.3.1版本,永久有效激活码,亲测可用,记得收藏

    Idea激活码最新教程2021.3.1版本,永久有效激活码,亲测可用,记得收藏Idea 激活码教程永久有效 2021 3 1 激活码教程 Windows 版永久激活 持续更新 Idea 激活码 2021 3 1 成功激活

    2025年5月21日
    2
  • 国内外常用公共NTP网络时间同步服务器地址[通俗易懂]

    国内外常用公共NTP网络时间同步服务器地址[通俗易懂]【腾讯云】热门云产品首单特惠秒杀,1核2G云服务器首年38元目录太长不看NTPPoolProjectNTP.ORG.CNNTP授时快速域名服务HSDN(HomeServerDataNetwork)本地服务器数据网络企业阿里巴巴腾讯微软苹果谷歌FacebookCloudflare高通HurricaneElectric飓风电气MSK-IX(MoscowInterneteXchange)莫斯科网络交换INTERNET…

    2022年6月15日
    81
  • 值得收藏:一份非常完整的 MySQL 规范(二)

    值得收藏:一份非常完整的 MySQL 规范(二)

    2022年2月13日
    35
  • Chain of Responsibility职责链[通俗易懂]

    Chain of Responsibility职责链[通俗易懂]职责链 Chain of Responsibility动机模式定义实例结构要点总结笔记动机在软件构建过程中,一个请求可能被多个对象处理.但是每个请求在运行时只能有一个请求者.如果显示指定.将必不可少地带来请求发送者与接收者地紧耦合如何使请求地发送者不需要指定具体地接收者?让请求地接收者自己在运行时决定来处理请求,从而使两者解耦模式定义使多个对象都有机会处理请求 从而避免请求地发送者和接收者之间地耦合关系.将这些对象形成一条链.并沿着这条链传递请求.直到有一个对象处理它为止实例#include&

    2022年8月9日
    4
  • day07_Scanner类,Random类,ArrayList类

    day07_Scanner类,Random类,ArrayList类

    2021年5月19日
    105
  • C 移位运算

    C 移位运算移位运算分为左移 lt lt 与右移 gt gt 包含逻辑移位 logicalshift 和算术移位 arithmeticsh 二者区别如下 1 逻辑移位 移出去的位丢弃 空缺位 vacantbit 用 0 填充 2 算术移位 移出去的位丢弃 空缺位 vacantbit 用符号位来填充 移位算只能作用于整数 不能作用于浮点数 对于无符号整数与有符号整数 左移

    2025年10月30日
    3

发表回复

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

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