使用Navicat for MySQL把本地数据库上传到服务器
发布于2018-05-09 00:18:11
服务器系统基本都是基于linux的,这个数据库上传的方式适用于linux的各种版本,比如Ubuntu和Centos(尽管这两个版本各种大坑小坑,但至少在数据库传输上保持了一致性)
当然本地数据库上传到服务器的前提是,服务器也已经安装好了MySQL数据库
1.在服务器端:
1.linux如何查看mysql是否启动
service mysqld status
mysqld is stopped 那就说明mysql服务是停止状态
mysqld is running 那就说明mysql服务是启动状态
2.重启mysql
service mysqld restart
3.登录mysql
#如果是刚刚安装了mysql,密码为空,直接按Enter键(回车)就进去了,如果已经设置了密码,就填写密码登录 mysql -uroot -p
4.给远程访问设置权限
#其中123456是用于连接的密码,读者可以将其设置得更加复杂一些 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;
#设置密码,如果是新安装的mysql需要在这里把密码设置了,如果已经有密码了就不用了
set password =password(‘123456’);
flush privileges;
5.退出mysql
quit
2.在本地:
1.安装Navicat
虽然这个软件是收费的,但是给了20天试用期,所以可以放心大胆的用正版,毕竟,上传数据库这种事儿,只在项目上线部署的时候用一次,20天怎么也够用了。
2.建立连接
1.先新建连接,跟本地数据库连上,连接名随便起一个就可以,如图
图1
图2
图3
2.再新建连接,跟服务器数据库连上,连接名也随便起一个就可以,如图
图1
图2
3.数据传输,如图
图1
图2
图3
至此,完成了本地数据库传输到服务器的过程
可以到服务器端,进入mysql查看一下,是否已经上传成功:
http://www.xfz1235.cn/
http://news.koi7857.cn/
http://www.dsd3012.cn/
http://www.ife7579.cn/
http://www.gtt6107.top/
http://www.ewh1005.cn/
http://www.tzr5175.cn/
http://news.wqr1047.cn/
http://www.zps7191.cn/
http://news.taj7240.cn/
http://news.hud3144.cn/
http://www.bpa2365.cn/
http://news.kjx4882.cn/
http://www.ece1729.cn/
http://news.vii0197.cn/
http://www.evv5980.cn/
http://www.wsa2392.cn/
http://www.mzj8672.cn/
http://news.tzr5175.cn/
http://www.vdx0926.cn/
http://news.xjy3902.cn/
http://www.jfs6888.top/
http://news.ece1729.cn/
http://www.tqz4909.cn/
http://www.qeu2095.top/
http://news.dkk2480.cn/
http://news.oek0353.cn/
http://www.myo1179.cn/
http://www.iit3286.cn/
http://news.hyt6211.cn/
http://www.lhl7110.cn/
http://www.syh5891.cn/
http://www.mfu9569.cn/
http://www.tud8565.cn/
http://www.ewv7964.cn/
http://news.ube1531.cn/
http://www.hyt6211.cn/
http://www.dkk2480.cn/
http://news.ppr6189.cn/
http://www.vdf1425.cn/
http://www.xvn7640.cn/
http://www.bbe1708.cn/
http://news.nat5354.cn/
http://news.aht8537.cn/
http://news.eko5785.cn/
http://news.alj9141.cn/
http://news.xip7382.cn/
http://www.veo6686.cn/
http://news.dfr2203.cn/
http://www.nuq3623.top/
http://www.oiv1998.top/
http://www.gum4900.top/
http://www.xua4102.cn/
http://news.vtl3405.cn/
http://news.aua2439.cn/
http://news.yxp3496.cn/
http://news.grp2563.cn/
http://www.epv8502.cn/
<li class="tool-item tool-active is-like "><a href="javascript:;"><svg class="icon" aria-hidden="true"> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#csdnc-thumbsup"></use> </svg><span class="name">点赞</span> <span class="count">5</span> </a></li> <li class="tool-item tool-active is-collection "><a href="javascript:;" data-report-click="{"mod":"popu_824"}"><svg class="icon" aria-hidden="true"> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-csdnc-Collection-G"></use> </svg><span class="name">收藏</span></a></li> <li class="tool-item tool-active is-share"><a href="javascript:;" data-report-click="{"mod":"1582594662_002"}"><svg class="icon" aria-hidden="true"> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-csdnc-fenxiang"></use> </svg>分享</a></li> <!--打赏开始--> <!--打赏结束--> <li class="tool-item tool-more"> <a> <svg t="1575545411852" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5717" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M179.176 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5718"></path><path d="M509.684 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5719"></path><path d="M846.175 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5720"></path></svg> </a> <ul class="more-box"> <li class="item"><a class="article-report">文章举报</a></li> </ul> </li> </ul> </div> </div> <div class="person-messagebox"> <div class="left-message"><a href="https://blog.youkuaiyun.com/kkfd1002"> <img src="https://profile.csdnimg.cn/D/A/9/3_kkfd1002" class="avatar_pic" username="kkfd1002"> <img src="https://g.csdnimg.cn/static/user-reg-year/1x/2.png" class="user-years"> </a></div> <div class="middle-message"> <div class="title"><span class="tit"><a href="https://blog.youkuaiyun.com/kkfd1002" data-report-click="{"mod":"popu_379"}" target="_blank">kkfd1002</a></span> </div> <div class="text"><span>发布了0 篇原创文章</span> · <span>获赞 23</span> · <span>访问量 12万+</span></div> </div> <div class="right-message"> <a href="https://im.youkuaiyun.com/im/main.html?userName=kkfd1002" target="_blank" class="btn btn-sm btn-red-hollow bt-button personal-letter">私信 </a> <a class="btn btn-sm bt-button personal-watch" data-report-click="{"mod":"popu_379"}">关注</a> </div> </div> </div> </article>