配置远程连接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

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

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

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)
blank

相关推荐

  • 二进制的减法

    二进制的减法注:正数的补码是其自身负数的补码是其反码+1这里需要说明的是,在计算机中做二进制数运算时,一定要明确是在多少位的整型前提下进行的,这样才能够正确处理位数溢出的问题。其实减法也可以看成加法6+(-4)无论加减法总结:补码相加结果再求补码1表示负0表示正在计算机中,负数是使用它的补码来表示的。所谓补码,就是反码+1。所谓反码,就是二进制数逐位取反。所谓逐位取反,就是1变成0,0变成1。例如:原来的二进制数:1011011101101反码:01001000100..

  • h5调用微信支付_h5打开小程序

    h5调用微信支付_h5打开小程序h5注册公众号jssdk,使用微信方法h5注册公众号jssdk,使用微信方法h5注册公众号jssdk,使用微信方法首先引入必要的js,http://res2.wx.qq.com/open/js/jweixin-1.4.0.js,可用https。然后进行验证,通过wx.config接口wx.config({debug:true,//开启调试模式,调用的所有api的返回值会在客户端…

  • iec104规约遥测遥信解析笔记「建议收藏」

    iec104规约遥测遥信解析笔记「建议收藏」最近在写104规约的解析暂时做一个笔记,先写一个遥信的后期再补全规约解析表如下:104规约解析 启动字符 1字节 取值 68H APCI应用规约控制信息 APDU应用规约数据单元 …

  • YouTube为什么打不开?以及简便的訪问的方法/解决方式!

    YouTube为什么打不开?以及简便的訪问的方法/解决方式!

  • origin绘图软件安装包及入门使用

    origin绘图软件安装包及入门使用1、安装包(2018版)origin是大多被数科研人员选择的数据绘图软件,功能齐全,简单易用,百度云:链接:https://pan.baidu.com/s/1fQRtfwczwye8MfPDi6BmrQ提取码:y72a安装过程及破解方法比较简单自行搜索2、软件界面介绍打开软件如下图所示,1、book用来存放实验数据,如果有多个Y值可以点击工具栏中“列”来添加更多的列值。表格中的数据可以直接从excle中复制进来,简单易用。2、绘图:在book中加入数据后,选中数据选择左下…

  • oracle insert 多行 select

    oracle insert 多行 selectinsertintosys_user_role(roleid,userid)selectroleid,useridfromsys_tmp;多行插入insertintosys_user_role(roleid,userid) selectroleid,’$B’userid from sys_user_rolewhereuserid=’$A’;

发表回复

您的电子邮箱地址不会被公开。

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