码迷,mamicode.com
首页 > 数据库 > 详细

数据库部署到linux服务器,供本地访问。

时间:2018-12-17 22:02:51      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:color   class   远程服务   本地   roo   not   部署   server   font   

1.  将本地的sql文件上传至服务器

  scp /Users/fangke/Documents/article.sql root@IP:/usr/local

2. 登陆服务器的mysql

 

3. 创建数据库

 

4. 执行sql文件

  source /usr/local/article.sql

 

5. 这个时候如果本地去访问的话,会报错。

  message from server: "Host ‘58.100.23.57‘ is not allowed to connect to this MySQL server"

 

6. 修改远程服务器mysql的被访问权限

  1)  use mysql;

  2)  update user set host =‘%‘ where user =‘root‘;

  重启远程mysql服务器

  service mysql restart

 

完结

数据库部署到linux服务器,供本地访问。

标签:color   class   远程服务   本地   roo   not   部署   server   font   

原文地址:https://www.cnblogs.com/fangke/p/10134109.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!