Linux下的Mysql,导入执行sql文件命令

mysql -u root -p dbname < filename.sql
执行上述命令,会提示你输入root账户的密码,密码验证成功后会在dbname这个数据库中执行filename.sql这个脚本。
filename.sql处填写你的<a target=_blank target="_blank" class="keylink" style="color: rgb(67, 167, 239); text-decoration: underline; width: 26px; height: 22px; line-height: 22px; border: 1px dotted rgb(170, 170, 170); text-align: center; background-color: rgb(255, 255, 255);">sql文件</a>所在的路径。
例如:mysql -u root -p dbname < /home/root/news.sql
</pre><pre class="best-text mb-10" id="best-content-610267162" name="code" style="white-space: pre-wrap; word-wrap: break-word; color: rgb(51, 51, 51); font-size: 14px; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; line-height: 24px; background-color: rgb(241, 254, 221);">FROM :  <a target=_blank target="_blank" href="http://www.zhuitaiyang.com/html/2013/linux_1012/428.html" style="color: rgb(51, 102, 153); text-decoration: none;">http://www.zhuitaiyang.com/html/2013/linux_1012/428.html</a>
</pre><pre class="best-text mb-10" id="best-content-610267162" name="code" style="white-space: pre-wrap; word-wrap: break-word; color: rgb(51, 51, 51); font-size: 14px; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; line-height: 24px; background-color: rgb(241, 254, 221);">
参考:  <a target=_blank target="_blank" href="http://www.111cn.net/database/mysql/45680.htm" style="color: rgb(51, 102, 153); text-decoration: none;">http://www.111cn.net/database/mysql/45680.htm</a>
<a target=_blank target="_blank" href="http://database.51cto.com/art/201005/201902.htm" style="color: rgb(51, 102, 153); text-decoration: none;">http://database.51cto.com/art/201005/201902.htm</a>
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值