服务器上 MySql 8.0.16创建远程连接账号

1. 终端连接服务器

  ssh -p 端口号 用户名@ip地址

  例如:ssh -p 22 yyy@1.2.3.4

2.进入mysql

  mysql -u 用户名 -p

  然后输入密码

3.创建远程账号

<style></style>

  3.1 use mysql;

 

  3.2 select  User,authentication_string,Host from user;

 

  3.3 create user 用户名@'%' identified by '密码'

 

  3.4 grant all privileges on *.* to 用户名@'%' with grant option;

 

  3.5 flush privileges;

  

按步骤即可创建成功

<style></style> <style></style> <style></style> <style></style>
上一篇:Navicat连接阿里云服务器MSQL数据库


下一篇:如何在suse机器上授予“无root用户”权限来启动/停止/重启mysql服务器?