配置远程连接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)
上一篇 2022年4月11日 下午6:00
下一篇 2022年4月11日 下午6:00


相关推荐

  • Qwen-Image-Edit-F2P C++调用指南[可运行源码]

    Qwen-Image-Edit-F2P C++调用指南[可运行源码]

    2026年3月13日
    2
  • RMQ 区间最值问题

    RMQ 区间最值问题RangeMinimum MaximumQuery 问题描述搜索 暴力解 线段树稀疏表 ST 笛卡尔树现在在 HBUE 读本科 小日子过的有点闲就具体的来抓几个点 补补算法问题描述对于长度为 n 的数列 A 回答若干 q 次 询问 RMQ A i j 返回数列 A 中下标在 i j 里的最大 小值搜索 暴力解 publicclassM publicintRMQ int A inti intj intans

    2026年3月19日
    2
  • tomcat是什么

    tomcat是什么简单总结下 tomcat 是一个中间件 在 B S 架构中 浏览器发出的 http 请求经过 tomcat 中间件 转发到最终的目的服务器上 响应消息再通过 tomcat 返回给浏览器 tomcat 所做的事情主要有 开启监听端口监听用户的请求 解析用户发来的 http 请求然后访问到你指定的应用系统 然后你返回的页面经过 tomcat 返回给用户 Apache Nginx 和 Tomcat 的区别 Apache 全称是

    2026年3月19日
    1
  • idea2021最新激活码(注册激活)

    (idea2021最新激活码)这是一篇idea技术相关文章,由全栈君为大家提供,主要知识点是关于2021JetBrains全家桶永久激活码的内容https://javaforall.net/100143.htmlIntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,上面是详细链接哦~1STL5S9V8F-eyJsaWNlb…

    2022年3月27日
    629
  • 命令行卸载java_卸载java「建议收藏」

    命令行卸载java_卸载java「建议收藏」有小伙伴经常会遇到Java没有卸载干净的情况,造成重新安装JDK能正常安装,接着安装JRE的时候总是报1603错误。虽然说JRE安装报错了没安装上,但是eclipse、IntelliJIDEA和AndroidStudio都能正常打开和使用,然而在命令行里却无法使用。小编今天和大家分享一下怎样彻底的卸载java,有需要的小伙伴不妨接着往下看。方法一:直接卸载,步骤比较繁琐,但是也能彻底卸载干净。1…

    2022年5月19日
    58
  • 三大分析法——SWOT、PEST、波特五力

    三大分析法——SWOT、PEST、波特五力SWOT分析法「SWOT分析模型简介」(也称TOWS分析法、道斯矩阵)。在现在的战略规划报告里,SWOT分析应该算是一个众所周知的工具。来自于麦肯锡咨询公司的SWOT分析,包括分析企业的优势(Strengths)、劣势(Weaknesses)、机会(Opportunities)和威胁(Threats)。因此,SWOT分析实际上是将对企业内外部条件各方面内容进行综合和概括,进而分析组织的优劣势、面临的机会和威胁的一种方法。通过SWOT分析,可以帮助企业把资源和行动聚集在自己的强项和有最多机会的地方

    2022年5月1日
    58

发表回复

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

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