29 07 2019

首先登录mysql:

undefined

然后执行下面两条命令就可开启mysql远程连接:

#允许所有用户远程访问 修改用户名和密码为你自己的
mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
#允许单个ip 修改用户名和密码为你自己的
mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'1.2.3.4' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
#最后
mysql> FLUSH PRIVILEGES;

undefined

最后成功连上服务器的MySQL,ლ(•̀ _ •́ ლ)

延伸阅读
  1. 码云 VS首次提交代码报错:failed to push some refs to 'https://gitee.com/Liu_Cabbage/ASP.NET-MVC-QQ-Connect.git'
  2. Mysql 随机获得表的几条记录
发表评论