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>