<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[IT初学者]]></title> 
<description><![CDATA[IT初学者记录]]></description>
<link></link>
<language>zh-cn</language>
<generator>www.emlog.net</generator>
<item>
	<title>mssql2000孤立用户解决方案</title>
	<link>?post=37</link>
	<description><![CDATA[<p style="color:#333333;font-family:Arial;font-size:14px;line-height:26px;"><a href="http://support.microsoft.com/kb/274188" style="color:#336699;text-decoration:none;">http://support.microsoft.com/kb/274188</a><br />
PRB：联机丛书中的“孤立用户疑难解答”主题不完整<br />
文章 ID : 274188&nbsp;<br />
最后更新日期 : 2004年5月31日&nbsp;<br />
版本 : 1.0&nbsp;<br />
本页内容<br />
&nbsp;症状&nbsp;<br />
&nbsp;状态&nbsp;<br />
&nbsp;更多信息&nbsp;<br />
&nbsp;参考</p>
<p style="color:#333333;font-family:Arial;font-size:14px;line-height:26px;">症状<br />
当您将数据库备份恢复到另一台服务器时，可能会遇到孤立用户的问题。SQL Server 联机丛书中的孤立用户疑难解答主题中没有讲述解决此问题的具体步骤。</p>
<p style="color:#333333;font-family:Arial;font-size:14px;line-height:26px;">本文介绍了如何解决孤立用户问题。&nbsp;<br />
状态<br />
Microsoft 已经确认这是在本文开头列出的 Microsoft 产品中存在的问题。&nbsp;<br />
更多信息<br />
虽然术语“登录”和“用户”经常交换使用，但它们之间有很大的不同。登录用于用户身份验证，而数据库用户帐户用于数据库访问和权限验证。登录通过安全识别符 (SID) 与用户关联。访问 SQL Server 服务器需要登录。验证特定登录是否有效的过程称为“身份验证”。登录必须与 SQL Server 数据库用户相关联。您使用用户帐户控制数据库中执行的活动。如果数据库中不存在针对特定登录的用户帐户，使用该登录的用户即使能够连接到 SQL Server 服务器，也无法访问数据库。但是，该情形的唯一例外是当数据库包含“guest”用户帐户时。与用户帐户不关联的登录将被映射到 guest 用户。相反，如果存在数据库用户，但没有与其关联的登录，则该用户将无法登录到 SQL Server 服务器中。</p>
<p style="color:#333333;font-family:Arial;font-size:14px;line-height:26px;">将数据库恢复到其他服务器时，数据库中包含一组用户和权限，但可能没有相应的登录或者登录所关联的用户可能不是相同的用户。这种情况被称为存在“孤立用户”。&nbsp;<br />
孤立用户疑难解答<br />
当您将数据库备份恢复到另一台服务器时，可能会遇到孤立用户的问题。以下情形说明了该问题并阐述如何加以解决。 1. 向主数据库添加一个登录，并将默认数据库指定为 Northwind： Use master go sp_addlogin 'test', 'password', 'Northwind'<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;<br />
2. 向刚创建的用户授予访问权限： Use Northwind go sp_grantdbaccess 'test'<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;<br />
3. 备份数据库。 BACKUP DATABASE Northwind<br />
TO DISK = 'C:/MSSQL/BACKUP/Northwind.bak'<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;<br />
4. 将数据库恢复到其他 SQL Server 服务器： RESTORE DATABASE Northwind<br />
FROM DISK = 'C:/MSSQL/BACKUP/Northwind.bak'<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
恢复的数据库包含名为“test”的用户，但没有相应的登录，这就导致“test”成为孤立用户。&nbsp;<br />
5. 现在，为了检测孤立用户，请运行此代码： Use Northwind go sp_change_users_login 'report'<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
输出中列出了所有登录，其中包含 Northwind 数据库的 sysusers 系统表和主数据库的 sysxlogins 系统表中不匹配的条目。</p>
<p style="color:#333333;font-family:Arial;font-size:14px;line-height:26px;">解决孤立用户问题的步骤<br />
1. 为前一步中的孤立用户运行以下命令：&nbsp;<br />
Use Northwind<br />
go<br />
sp_change_users_login 'update_one', 'test', 'test'<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
这样，就将服务器登录“test”与 Northwind 数据库用户“test”重新连接起来。sp_change_users_login 存储过程还可以使用“auto_fix”参数对所有孤立用户执行更新，但不推荐这样做，因为 SQL Server 会尝试按名称匹配登录和用户。大多数情况下这都是可行的；但是，如果用户与错误登录关联，该用户可能拥有错误的权限。&nbsp;<br />
2. 在上一步中运行代码后，用户就可以访问数据库了。然后用户可以使用 sp_password 存储过程更改密码： Use master<br />
go<br />
sp_password NULL, 'ok', 'test'<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
此存储过程不能用于 Microsoft Windows NT 安全帐户。通过 Windows NT 网络帐户连接到 SQL Server 服务器的用户是由 Windows NT 授权的；因此，这些用户只能在 Windows NT 中更改密码。</p>
<p style="color:#333333;font-family:Arial;font-size:14px;line-height:26px;">只有 sysadmin 角色的成员可以更改其他用户的登录密码。</p>
<p style="color:#333333;font-family:Arial;font-size:14px;line-height:26px;">参考<br />
有关在服务器之间移动数据库时如何解决权限问题的其他信息，请单击下面的文章编号，查看 Microsoft 知识库中相应的文章：&nbsp;<br />
240872 INF：在 SQL 服务器之间移动数据库时如何解决权限问题&nbsp;</p>]]></description>
	<pubDate>Fri, 27 Mar 2015 14:24:12 +0000</pubDate>
	<author>站长</author>
	<guid>?post=37</guid>

</item>
<item>
	<title>访问phpmyadmin时出现空白的解决方案</title>
	<link>?post=29</link>
	<description><![CDATA[<p>这里我只是针对我这出现的情况，如果您也有这种情况可以试试这个方法。</p>
<p>&nbsp;</p>
<p>一直以为有些人访问phpmyadmin时会出现空白，我一开始以为是和IE的版本有关，不过的确是有些IE版本会出现这样的问题，但总不能让他们老是换个浏览器吧，于是我调试了一下，后来发现是php禁用了ob_gzhandler的原因。</p>
<p>&nbsp;</p>
<p>当时因为一些原因，把ob_gzhandler函数禁止了，也就是禁止发送加密的html，而phpmyadmin设置了发送这个。</p>
<p>&nbsp;</p>
<p>出现这种情况如下：一，在php.ini中禁止了ob_gzhandler这个函数；二，phpmyadmin的config.inc.php中$cfg['OBGzip']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
= 'auto';一行</p>
<p>&nbsp;</p>
<p>解决方案：</p>
<p>一种方法就是解开ob_gzhandler函数禁止</p>
<p>另一种方法就是在phpmyadmin的config.inc.php中$cfg['OBGzip']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 
FALSE;</p>]]></description>
	<pubDate>Tue, 19 Nov 2013 06:23:36 +0000</pubDate>
	<author>站长</author>
	<guid>?post=29</guid>

</item>
<item>
	<title>register_globals must is Off</title>
	<link>?post=15</link>
	<description><![CDATA[<pre class="reply-text mb10" id="best-answer-content" sizcache="16" sizset="45">由于register_globals设置控制PHP变量访问范围,如果开启会引起不必要的安全问题,</pre><pre class="reply-text mb10" sizcache="16" sizset="45">所以这里对其进行了强制关闭,如果站长的空间不支持,可以采用以下几种办法进行修改,</pre><pre class="reply-text mb10" sizcache="16" sizset="45">供广大站长参考： 

*如果是独立服务器的用户可以修改php配置文件中的php.ini,将register_globals=On</pre><pre class="reply-text mb10" sizcache="16" sizset="45">改为register_globals=Off,然后重启Apache. 

*如果是虚拟主机的用户,尽可能的通知空间商让其对配置进行修改,</pre><pre class="reply-text mb10" sizcache="16" sizset="45">或者可以尝试ini_set('register_globals',0)来. 

*自己在网站目录下新建一个.htaccess文件，加上php_flag register_globals off 就行了，</pre><pre class="reply-text mb10" sizcache="16" sizset="45">如果已有.htaccess文件，直接再最后另起一行添加即可； 

*如果实在不行,那只有采用最后的办法直接去include/common.inc.php中将以下代码删除即可
 ----
//开启register_globals会有诸多不安全可能性，因此强制要求关闭register_globals
if ( ini_get('register_globals') )
{
    exit('&lt;a href="<a href="http://docs.dedecms.com/doku.php?id=register_globals" target="_blank">http://docs.dedecms.com/doku.php?id=register_globals</a>"&gt;</pre><pre class="reply-text mb10" sizcache="16" sizset="45">php.ini register_globals must is Off! &lt;/a&gt;');
}</pre><pre class="reply-text mb10" sizcache="16" sizset="45">&nbsp;</pre><pre class="reply-text mb10" sizcache="16" sizset="45">骑士的cms的话，可以修改 </pre><pre class="reply-text mb10" sizcache="16" sizset="45">admin/admin_login.php 下的：</pre><pre class="reply-text mb10" sizcache="16" sizset="45">if (ini_get('register_globals'))
&nbsp;{
&nbsp;&nbsp;exit("请先将php.ini中register_globals设为Off");
&nbsp;}</pre><pre class="reply-text mb10" sizcache="16" sizset="45">直接屏蔽这段代码</pre>]]></description>
	<pubDate>Wed, 20 Jun 2012 02:49:39 +0000</pubDate>
	<author>站长</author>
	<guid>?post=15</guid>

</item>
<item>
	<title>Notice: Undefined variable: data in</title>
	<link>?post=7</link>
	<description><![CDATA[<div id="threadtitle" style="color:#666666;font-family:Tahoma, Arial;font-size:14px;line-height:24px;"><h1 style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;">网站出问题了，打不开，Notice: Undefined variable: data in</h1>
<div class="threadtags"></div>
</div>
<div class="t_msgfontfix" style="color:#666666;font-family:Tahoma, Arial;font-size:14px;line-height:24px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="t_msgfont" id="postmessage_503718"><br />
<br />
<strong>Notice</strong>: Undefined variable: data in&nbsp;<strong>F:\freehost\b2btianshu\web\<span class="t_tag" href="http://www.zh0756.cn/admin/tag.php?name=includes">includes</span>\lib_base.php</strong>&nbsp;on line&nbsp;<strong>1241<br />
<br />
Warning</strong>: require(F:/freehost/b2btianshu/web/languages//common.php) [<a href="http://www.ts00.com/function.require" target="_blank" style="text-decoration:none;"><span style="color:#800080;">function.require</span></a>]: failed to open stream: No such file or directory in<strong>F:\freehost\b2btianshu\web\includes\init.php</strong>&nbsp;on line&nbsp;<strong>124<br />
<br />
Fatal&nbsp;<span class="t_tag" href="http://www.zh0756.cn/admin/tag.php?name=error">error</span></strong>: require() [<a href="http://www.ts00.com/function.require" target="_blank" style="text-decoration:none;"><span style="color:#800080;">function.require</span></a>]: Failed opening required 'F:/freehost/b2btianshu/web/languages//common.php' (include_path='.;F:/freehost/b2btianshu/web/') in<strong>F:\freehost\b2btianshu\web\includes\init.php</strong>&nbsp;on line&nbsp;<strong>124<br />
<br />
<br />
<span class="t_tag" href="http://www.zh0756.cn/admin/tag.php?name=%BA%F3%CC%A8">后台</span>也打不开 后台<span class="t_tag" href="http://www.zh0756.cn/admin/tag.php?name=%CC%E1%CA%BE">提示</span><br />
Notice</strong>: Undefined variable: data in&nbsp;<strong>F:\freehost\b2btianshu\web\includes\lib_base.php</strong>&nbsp;on line&nbsp;<strong>1241<br />
<br />
Warning</strong>: require(F:/freehost/b2btianshu/web/languages//admin/common.php) [<a href="http://www.ts00.com/admin/function.require" target="_blank" style="text-decoration:none;"><span style="color:#0000ff;">function.require</span></a>]: failed to open stream: No such file or directory in<strong>F:\freehost\b2btianshu\web\admin\includes\init.php</strong>&nbsp;on line&nbsp;<strong>162<br />
<br />
Fatal error</strong>: require() [<a href="http://www.ts00.com/admin/function.require" target="_blank" style="text-decoration:none;"><span style="color:#0000ff;">function.require</span></a>]: Failed opening required 'F:/freehost/b2btianshu/web/languages//admin/common.php' (include_path='.;ROOT_PATH') in<strong>F:\freehost\b2btianshu\web\admin\includes\init.php</strong>&nbsp;on line&nbsp;<strong>162<br />
<br />
</strong><div class="t_msgfontfix">解决方法：</div>
<div class="t_msgfontfix"><div class="postmessage "><div class="t_msgfontfix"><table cellspacing="0" cellpadding="0" class=" "><tbody><tr><td class="t_msgfont" id="postmessage_667254">到temp文件夹下的static_caches文件下的文件都删除就可以了</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<br class="Apple-interchange-newline" />]]></description>
	<pubDate>Sat, 19 May 2012 13:08:48 +0000</pubDate>
	<author>站长</author>
	<guid>?post=7</guid>

</item></channel>
</rss>