Rumah >pangkalan data >tutorial mysql >修改sqlserver2008默认的数据库文件保存路径

修改sqlserver2008默认的数据库文件保存路径

WBOY
WBOYasal
2016-06-07 15:54:011702semak imbas

在配置工具中,右键服务器,然后选择属性。 然后数据库设置,再配置数据库默认位置 方法二,直接使用sql语句修改 USE [ master ] GO EXEC xp_instance_regwrite N HKEY_LOCAL_MACHINE , N Software\Microsoft\MSSQLServer\MSSQLServer , N DefaultData , REG

在配置工具中,右键服务器,然后选择属性。

然后数据库设置,再配置数据库默认位置

 

方法二,直接使用sql语句修改

<code style="margin: 0px; padding: 0px;"><span class="kwd" style="margin: 0px; padding: 0px;">USE<span class="pln" style="margin: 0px; padding: 0px;"> <span class="pun" style="margin: 0px; padding: 0px;">[<span class="pln" style="margin: 0px; padding: 0px;">master<span class="pun" style="margin: 0px; padding: 0px;">]<span class="pln" style="margin: 0px; padding: 0px;">
GO
<span class="kwd" style="margin: 0px; padding: 0px;">EXEC<span class="pln" style="margin: 0px; padding: 0px;"> xp_instance_regwrite N<span class="str" style="margin: 0px; padding: 0px;">&#39;HKEY_LOCAL_MACHINE&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;Software\Microsoft\MSSQLServer\MSSQLServer&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;DefaultData&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> REG_SZ<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;E:\YourData&#39;<span class="pln" style="margin: 0px; padding: 0px;">
GO
<span class="kwd" style="margin: 0px; padding: 0px;">EXEC<span class="pln" style="margin: 0px; padding: 0px;"> xp_instance_regwrite N<span class="str" style="margin: 0px; padding: 0px;">&#39;HKEY_LOCAL_MACHINE&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;Software\Microsoft\MSSQLServer\MSSQLServer&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;DefaultLog&#39;<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> REG_SZ<span class="pun" style="margin: 0px; padding: 0px;">,<span class="pln" style="margin: 0px; padding: 0px;"> N<span class="str" style="margin: 0px; padding: 0px;">&#39;E:\YourLogs&#39;<span class="pln" style="margin: 0px; padding: 0px;">
GO </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code>
Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn