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>