mysql如何查看远程用户_MySQL系列(十)--用户权限及远程访问

本文基于MySQL8.0,记录一下完整的远程访问的过程,以及这个过程中可能遇到的问题,MySQL运行在阿里云服务器,操作系统:CentOS 7.6 64位

顺便说下,买服务器还是要双十二这种拉新活动再买,用一个新的支付宝账号购买,能便宜一大半,不然双核4G就两千多块了。

这里默认防火墙已经向外暴露3306端口/关闭防火墙了,以及阿里云安全组配置暴露3306端口,在Windows通过Navicat测试连接

随便创建一个用户:

mysql> create user 'dev'@'localhost' identified by 'huluhulu';  //创建用户dev,只能在localhost使用,密码huluhulu

Query OK,0 rows affected (0.00sec)

mysql> select host, user ,authentication_string, plugin from user;  //查看user,host,加密后的字符串,以及加密类型+-----------+------------------+------------------------------------------------------------------------+-----------------------+

| host | user | authentication_string | plugin |

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

| % | root | *43C685FF9E03403DD721CF54B4E40B199DA06624 | mysql_native_password |

| % | test | *43C685FF9E03403DD721CF54B4E40B199DA06624 | mysql_native_password |

| localhost | dev | $A$005$6dH-H a.'^JNmbBkSYomGJK2180WHglWpm4mw.BIJGtuPX0qcBrOLIcMqC | caching_sha2_password |

| localhost | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |

| localhost | mysql.session | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |

| localhost | mysql.sys | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | caching_sha2_password |

| localhost | root | *43C685FF9E03403DD721CF54B4E40B199DA06624 | mysql_native_password |

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

你可能感兴趣的:(mysql如何查看远程用户)