Download the Android SDK

 

Welcome Developers! If you are new to the Android SDK, please read the Quick Start, below, for an overview of how to install and set up the SDK.

If you are already using the Android SDK and would like to update to the latest tools or platforms, please use the Android SDK and AVD Manager to get the components, rather than downloading a new SDK package.

 

PlatformPackageSizeMD5 Checksum
Windows android-sdk_r06-windows.zip 23293160 bytes 7c7fcec3c6b5c7c3df6ae654b27effb5
Mac OS X (intel) android-sdk_r06-mac_86.zip 19108077 bytes c92abf66a82c7a3f2b8493ebe025dd22
Linux (i386) android-sdk_r06-linux_86.tgz 16971139 bytes 848371e4bf068dbb582b709f4e56d903

Quick Start

The steps below provide an overview of how to get started with the Android SDK. For detailed instructions, start with theInstalling the SDK guide.

1. Prepare your development computer

Read the System Requirements document and make sure that your development computer meets the hardware and software requirements for the Android SDK. Install any additional software needed before downloading the Android SDK. In particular, you may need to install the JDK (version 5 or 6 required) and Eclipse (version 3.4 or 3.5, needed only if you want develop using the ADT Plugin).

2. Download and install the SDK starter package

Select a starter package from the table at the top of this page and download it to your development computer. To install the SDK, simply unpack the starter package to a safe location and then add the location to your PATH.

3. Install the ADT Plugin for Eclipse

If you are developing in Eclipse, set up a remote update site at https://dl-ssl.google.com/android/eclipse/. Install the Android Development Tools (ADT) Plugin, restart Eclipse, and set the "Android" preferences in Eclipse to point to the SDK install location. For detailed instructions, see ADT Plugin for Eclipse.

4. Add Android platforms and other components to your SDK

Use the Android SDK and AVD Manager, included in the SDK starter package, to add one or more Android platforms (for example, Android 1.6 or Android 2.0) and other components to your SDK. If you aren't sure what to add, see Which components do I need?

To launch the Android SDK and AVD Manager on Windows, execute SDK Setup.exe, at the root of the SDK directory. On Mac OS X or Linux, execute the android tool in the <sdk>/tools/ folder. For detailed instructions, see Adding SDK Components.

Done!

If you are new to Android, you can use the Hello World tutorial to get started quickly. Next Steps offers other suggestions of how to begin.

For a more detailed guide to installing and setting up the SDK, read Installing the SDK.

---------------------------------------------------------------------------------------------------------------

很想不通gcd要把这个给封了,与政治毛关系也没有啊

点击上面的链接就可以得到下载地址了

 

Posted in Android | Comments(0)»

 

 

 

The main screen
Enlarge picture

Pretty much everyone must have heard by now about Google's famous Android operating system for handhelds, which, despite providing some pretty interesting features as far as the level of integration with various Google services is concerned, is still rather far from having reached the level of popularity enjoyed by other similar operating systems, such as Symbian or Windows Mobile. However, its potential is much more impressive, given the fact that it can be easily ported to run on x86 systems.

And proving their on-going commitment for developing this operating system, the developers from Google have just released a Live CD with the latest Android version, designed specifically in order to run on any PC, regardless of the particular operating systems running on the respective machines.

In order to get the Android running on your computer, you can choose two different methods: the very easy one (using a physical Live CD, which means that you'll have to burn the Android OS image onto a CD and then run it) and the bit more difficult one (using a virtual machine running on your computer, which is, nevertheless, a lot more interesting, since it doesn't involve any rebooting, so it also works for those people who don't have an optical unit able to burn discs).

My desktop PC doesn't really have a battery
Enlarge picture
Googling for Softpedia
Enlarge picture

And here are the details pertaining to the methods mentioned above:

Method 1: Burning your Live CD

Step 1 – Download the two parts of the Live CD .iso file from the LiveAndroid web page.
Step 2 – Combine the two segments into a single one using a specialized application (the projects' authors recommend HJSplit for the task).
Step 3 – Burn the resulting .iso image onto a blank CD using your favorite disc burning application.
Step 4 – Reboot your computer (make sure that the CD-ROM drive is placed ahead of the HDD in the list of boot devices).
Step 5 – Wait for it to load (getting past the Android Live CD splash screen might take a while) and then voila! You've gotten the Google Android operating system running without any problems on your computer.

Method 2: Running the Android OS on a virtual machine on your computer

While this second method is a bit more difficult than the first one, it's also a lot more rewarding, since it will allow you to run your other applications at the same time as the Android.

Our own gadgets section
Enlarge picture
Now that's a carrier I haven't heard about before
Enlarge picture

The first thing you'll have to do is install a virtual machine application, if you don't have one already installed. For example, we opted here for the Sun VirtualBox, simply because it provides networking support without forcing us to tinker further with the settings and the command prompt.

Furthermore, you'll also have to install an optical drive software emulator in order to get the LiveCD running within the virtual machine (of course, that depends on the virtual machine you're using. For VirtualBox, you won't need such an option, but for others, you might - thanks for pointing that out, Maldoror). We used the Daemon Tools Liteapplication for this purpose, but you can easily choose your own.

The various adjustable settings
Enlarge picture
The available developers' tools
Enlarge picture

So, here are the steps that you must follow in order to run the Android from your own computer directly. These are roughly general steps, but we're pretty sure you'll get the hang of it quite fast.

Step 1 – Download the two parts of the Live CD .iso file from the Android web page (link provided above).
Step 2 – Combine the two segments into a single one using a specialized application (the projects' authors recommend HJSplit for the task).
Step 3 – Download and install the virtualization software.
Step 4 – Download and install the CD/DVD emulator.
Step 5 – Mount the LiveCD image into the CD/DVD emulator.
Step 6 – Create a new virtual machine using the virtualization software (it's a good idea to allocate at least 256MB of RAM for this machine, while HDD space is not that important, but it should have at least a couple of hundreds of MB).
Step 7 – Inside the virtualization software, select the virtual drive on which the LiveCD image has been mounted as the boot drive. 
Step 8 – Start the virtual machine.

After finishing step 8, the virtual machine should start booting up. There, you will be able to access the Android OS, albeit in a fairly reduced version, namely only the shell. The fact that we're talking about a port here is visible everywhere, starting from the first screen you'll encounter (related to the battery power) and up to the settings and features. 

All the available apps
Enlarge picture
Spare parts menu
Enlarge picture

However, remember that this LiveCD is aimed mostly at developers, who actually have to create apps for this operating system, so normal users won't benefit too much from it, apart from the possibility to take a closer look at just what they are to expect from a Google-based OS.

 

本文转自:http://www.liuhuadong.com/archives/904/index.html

自从php5.3,越来越多的人会遇到“Assigning the return value of new by reference is deprecated in xxxx”这样的提示,尤其是在国外产品中(例如wordpress、joolma),很多人的解决办法很简单:把php版本换回就版本就ok了。毫无疑问这是个好办法,对这种遇到问题不求甚解的态度可能会让人看到些什么。我认为要换回php的旧版本,其实是对php技术爱好者的一种羞辱(用词不当,大致是这个意思)。解决办法:php5.3开始后,废除了php中的”=&”符号,所以要想复制,直接用=引用即可。详细如下:

1、PHP5对象复制是采用引用的方式;
2、如果不采用引用方式,则需要在复制对象时加关键字 clone;
3、如果在复制的过程中,同时要变更某些属性,则增加函数_clone();

Posted in PHP | Comments(0)»

MySQL :: Can't start service MySQL

I really agree with you, it took me couple of hours,but now I get it work. in fact, it's very easy when you find the problem.ok ,let's go: first,find the configuration setting file "my.ini" in your installation path of mysql. open the file,search the word "datadir",then,cope the path---datadir="datadir="D:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/" (this is my path,you should copy your path),and open the folder which includes several default database folders about mysql. finally, delete all of files in this folder(only file not folders). choose start-->run--->cmd---->input "net start mysql" in the command line. wait several seconds, will show mysql starts successful. ok,that is all. I don't know why do that ,please tell me if you know.

昨天把原有的数据给删了,之后从默认配置中无法启动myql服务,弄后一下午加一晚上,终于得到解决了

首先进入安装目录,将my.ini中的datadir的值更复制下来

然后进入刚才复制的目录下(我的是D:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/),删除里面所有文件但不要删除文件夹。

OK,cmd->net start mysql回车。。

MySQL 服务正在启动 .
MySQL 服务已经启动成功。

 

Posted in SQL | Comments(0)»

只针对windows系统下的修改,其它系统的请看http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-windows

 

里面讲到了三种操作系统的修改

下面开始讲了:

首先,停止mysql服务器,最简单的方法是-》进入任务管理器,找到mysqld进程,结束它就ok了。

其次,新建一个txt文件,复制下面的内容到文件中保存后修改文件名为mysql-init.txt然后放到c盘的根目录下(可以放在任何位置).

 

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;

 

 

  1. 再次打开命令提示符后:输入如下命令

     

    C:\mysql\bin\mysqld-nt --init-file=C:\\mysql-init.txt

     

  2. tart the MySQL server with the special --init-file option (notice that the backslash in the option 

    里面的路径要与你自己安装mysql的路径对应,后面那个路径是你刚才的文件位置。再按下回车

    value is doubled):

    C:\> C:\mysql\bin\mysqld-nt --init-file=C:\\mysql-init.txt
    

    If you installed MySQL to a location other than C:\mysql, adjust the command accordingly.

    The server executes the contents of the file named by the --init-file option at startup, changing each rootaccount password.

    You can also add the --console option to the command if you want server output to appear in the console window rather than in a log file.

    If you installed MySQL using the MySQL Installation Wizard, you may need to specify a --defaults-fileoption:

    C:\> "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt.exe"
             --defaults-file="C:\\Program Files\\MySQL\\MySQL Server 5.0\\my.ini"
             --init-file=C:\\mysql-init.txt
    

    The appropriate --defaults-file setting can be found using the Services Manager: From the Start menu, select Control Panel, then Administrative Tools, then Services. Find the MySQL service in the list, right-click it, and choose the Properties option. The Path to executable field contains the --defaults-file setting.

  3. After the server has started successfully, delete C:\mysql-init.txt.

You should now be able to connect to the MySQL server as root using the new password. Stop the MySQL server, then restart it in normal mode again. If you run the server as a service, start it from the Windows Services window. If you start the server manually, use whatever command you normally use.

 

Posted in SQL | Comments(0)»
Java支持UTF-8、ISO-8859-1、GBK等各种字体编码,可笔者发现Java中字体编码的问题仍难倒了不少程序员,网上虽然也有不少关于在Java中如何正确显示中文的文章,但都不够全面,笔者特意总结如下。 

影响Java中字体编码正确显示的有几个因素: 1)数据库的连接方式; 2)网页中使用的字体编码; 3)数据库里存放数据的字体编码; 4)Java的缺省字体编码。如果在编程中遇到不能正确显示中文时,要先弄清楚以上几项所使用的字体编码,再分析找出原因,即可解决问题。 

众所周知,JSP是Java的一种,和网页有关,而网页也有自己的中文编码系统,所以JSP处理中文要比纯Java的类文件更为麻烦。本文的测试数据库是MySQL3.2,数据库连接驱动是用org.gjt.mm.mysql.Driver,这里主要讨论UTF-8和GBK的显示( GB2312是GBK的一个子集,Java中可以使用GBK来代替GB系列)。我们先来研究JSP中字体编码问题,下面第一到第六点是针对JSP的(因为从数据库里读出中文数据与写入中文数据有所区别,咱们分别说明,前三点是从读取数据库到显示在网页,后三点是从网页输入数据到存入数据库),第七到第九点针对纯Java的类文件。以下rs表示ResultSet的一个实例,是执行Select语句之后产生的数据集。 

一、数据库连接方式使用UTF-8 

在连接数据库的驱动后面加上这句参数useUnicode=true&characterEncoding= 

UTF-8,例如jdbc:mysql://localhost/DBVF?autoReconnect=true&useUnicode= 

true&characterEncoding=UTF-8,从数据库里读出中文显示在使用GBK的JSP的网页里,如果数据库里存放的字体编码是UTF-8,在JSP中使用 str=new String(rs.getBytes(1),"UTF-8")或者str=rs.getString(1),可以正确显示中文。如果数据库里存放的是 GBK数据,那么JSP中也要使用str=new String(rs.getBytes(1),"GBK")来显示正确的中文。值得注意的是如果页面使用UTF-8,数据库里存放的是UTF-8,也可以用str=new String(rs.getBytes(1),"GBK")正确显示中文。如果网页是UTF-8,而数据库里存放的是GBK,无法直接显示中文,需要2步转换, str=new String(rs.getBytes(1),"GBK"); 再str=new String(str.getBytes("UTF-8"),"GBK"),才可以正确显示中文。 

二、数据库连接方式使用GBK 

在连接数据库的驱动后面加上这句参数useUnicode=true&characterEncoding= 

GBK,例如jdbc:mysql://localhost/DBVF?autoReconnect=true&UseUnicode=true& 

characterEncoding=GBK,从数据库里读出中文,显示在使用GBK的JSP的网页里,如果数据库里存放的字体编码是 UTF-8,在JSP中一定要使用 str=new String(rs.getBytes(1),"UTF-8"),才正确显示中文。如果数据库里存放的是GBK数据,那么JSP中也要使用str=new String(rs.getBytes(1),"GBK") 或者直接使用str=rs.getString(1),即可显示正确的中文。如果网页是UTF-8,而数据库里存放的是GBK,只能用str=new String(rs.getString(1).getBytes("UTF-8"),"GBK")的方法来显示中文; 如果网页是UTF-8,而数据库里存放的是UTF-8,可用str=new String(rs.getBytes(1),"GBK") 或者rs.getString(1)方法来显示中文。 

三、使用缺省数据库连接方式 

连接数据库的驱动后面没有这句参数useUnicode=&characterEncoding=,例如 jdbc:mysql://localhost/DBVF?autoReconnect=true,没有参数useUnicode=true& characterEncoding,表示使用默认的ISO-8895-1编码。 

1. 从数据库里读出中文,显示在GBK的网页里。如果数据库里存放的字体编码是UTF-8,在JSP网页中一定要使用语句 str=new String(rs.getBytes(1),"UTF-8") 或者str= new String(rs.getString(1).getBytes("ISO-8859-1"),"UTF-8"),才可正确显示中文。如果数据库里存放的是GBK数据,那么JSP中也要使用str=new String(rs.getBytes(1),"GBK")或str=new String(rs.getString(1).getBytes("ISO-8859-1"),"GBK") 显示正确的中文。 

2. 如果网页是UTF-8,不能直接正确显示GBK,需要2步转换,str=new String(rs.getBytes(1),"GBK"),再str=new String(str.getBytes("UTF-8"),"GBK") 才可以正确显示中文。如果数据库里存的是UTF-8,直接用str=new String(rs.getBytes(1),"GBK")或者str=new String(rs.getString(1).getBytes("ISO-8859-1"),"GBK")就可以显示中文了。 

以上是读取数据库里中文正确显示在网页上,下面三点是如何正确存入数据库。 

四、数据库连接方式使用UTF-8编码 

JSP中要把网页输入的中文存入数据库,通常有一个提交(Submit)的过程,是用 str=request.getParameter("username"),然后执行update或者insert语句来存入数据库。如何赋值给str 很重要,而且这里中文输入与网页所使用的字体编码有关。 

1、 网页使用UTF-8,使用str= new String(request.getParameter("username").getBytes("ISO-8859-1"),"UTF-8")或者str= new String(request.getParameter("username").getBytes(),"UTF-8"),都可以使得存到数据库里的数据是UTF-8编码。 

2. 网页使用GBK,使用str= new String(request.getParameter("username").getBytes(),"GBK"),那么存入数据库的是UTF-8编码。 

3. 值得注意的是使用UTF-8的数据库连接方式不能存得GBK。 

五、数据库连接方式使用GBK编码 

1. 输入使用GBK网页,存到数据库里是GBK的方法: str= new String(request.getParameter("username").getBytes("ISO-8859-1"),"GBK") 或者str= new String(request.getParameter("username").getBytes(),"GBK")。 

2. 网页使用GBK,想存入UTF-8到数据库里,要分2步: 先str=new String(request.getParameter("username").getBytes(),"GBK"),再str=new String(str.getBytes("UTF-8"),"GBK")即可。 

3. 网页使用UTF-8,而且使用str= new String(request.getParameter("username").getBytes("ISO-8859-1"),"GBK") 或者str= new String(request.getParameter("username").getBytes(),"UTF-8"),那么存到数据库里的数据是 UTF-8编码。 

4. 网页使用UTF-8,而且使用str= new String(request.getParameter("username").getBytes("ISO-8859-1"),"UTF-8"),那么存到数据库里的数据是GBK编码。 

六、数据库连接方式使用缺省,即不使用参数useUnicode和characterEncoding 

1. 网页使用GBK,如果使用str= request.getParameter("username")或者str= new String(request.getParameter("username").getBytes()),那么在数据库里的数据是GBK码。网页使用 UTF-8 和使用str= request.getParameter("username"),则存入数据库是UTF-8编码。 

2. 如果使用str= new String(request.getParameter("username").getBytes("ISO-8859-1")),那么根据网页提供的字体编码而存到数据库里,比如是UTF-8的网页,那么存到数据库中就是UTF-8编码,如果使用GBK网页,那么存到数据库里的字就是GBK编码。 

3. 如果使用str= new String(request.getParameter("username").getBytes("UTF-8"),"UTF-8")这一种组合能存到正确的数据外,其他存到数据库里的数据则都是乱码或者错误码。在这个UTF-8组合的特例中,网页使用的是GBK,则存放到数据库里就是GBK,网页使用UTF-8,那么存到数据库里的就是UTF-8。 

4. 网页是GBK的要存得UTF-8,一定需要2步: company=new String(request.getParameter("company").getBytes(),"GBK")和company=new String(company.getBytes("UTF-8"))。 

5. 网页是UTF-8的,不能存得GBK在数据库里,一句话,改变数据库连接方式不能存得GBK码。 

以上所有的都是基于JSP网页和数据库交换数据,下面讨论一下纯JAVA编程下的字体编码转换。 

七、数据库连接方式使用UTF-8编码 

1. 数据库里的中文是UTF-8,可以转换为GBK,但不能把GBK存入数据库。 

2. 数据库是GBK,如果转换为UTF-8,使用content=new String(rs.getBytes(2),"GBK")直接将content存入数据库就可为UTF-8。 

八、数据库连接方式使用GBK编码 

1. 数据库里的中文是UTF-8,如果转换为GBK,使用content= new String(rs.getString(2).getBytes(),"UTF-8"),再直接使用update或者insert语句插入到数据库,即存得GBK。如果使用content= new String(rs.getString(2).getBytes(),"GBK")或者content= new String(rs.getString(2).getBytes()),再存入数据库即存得还是UTF-8编码。 

2. 数据库里的中文是GBK,如果转换为UTF-8,使用content= new String(rs.getString(2).getBytes("UTF-8"))或者content= new String(rs.getString(2).getBytes("UTF-8"),"GBK"),再直接使用update或者insert语句插入到数据库,即存得UTF-8。 

3. 如果某个String是GBK,要转换为UTF-8,也是使用content= new String(GBKstr.getBytes("UTF-8"))或者content= new String(GBKstr.getBytes("UTF-8"),"GBK"); 如果某个String是UTF-8,要转换为GBK,应该使用new String(UTFstr.getBytes("GBK"),"UTF-8")。 

九、数据库连接方式使用缺省,即不跟参数 

1. str2=new String(GBKstr.getBytes("UTF-8"),"ISO-8859-1"),可以将数据库里的GBK编码转换为UTF-8。 

2. 读取UTF-8然后存入UTF-8,则用str1=new String(UTFstr.getBytes(),"ISO-8859-1")或者str1=new String(UTFstr.getBytes("GBK"),"ISO-8859-1")。 

3. 不能实现数据库里的UTF-8转换为GBK。 

如果采用UTF-8的数据库连接方式或者缺省数据连接方式,那么无法将UTF-8转为GBK;而GBK的数据库连接方式可以实现UTF-8和GBK的相互转换。建议大家采用GBK的数据连接方式。
Posted in JAVA | Comments(0)»

为了防止他人在没有经过允许的情况下乱用你的机器,现在分享一下bios设置开机密码(当然也可以用windows自带的账号密码设置,这里就不讲那个了)

注:这里以联想电脑主板为例子讲解,其它主板应该也差不多了

1、设置电源密码

也就是在开机时,只有输入密码,电源才能启动,有的人以为电源都没有连上,还谈什么密码问题,错.....,下面简单的谈一下bios,bios其实也就是事先写好的一段程序,检测主机的各种硬件,电脑时间的显示都在这里面写好的,开机前首先运行的是这段程序,这段程序的运行,并不依靠主机电源,而是主板上的一块大电子铝电池(打开机箱,可以看得很清楚)。从而可以设置电源密码,也就是没有这个密码不能连上电源,废话不多说了,翠花,上酸菜....

首先,开机时长按del键,进入bios设置菜单,找到选项“Integrated Peripherals”,应该是左栏的最后一项,按回车进入该选项,然后通过Page Down找到选项“Power On Function”,再次按回车进入,选择“password”项,按ESC键回到上一菜单,找到“ Power ON Password”上并Enter键,输入您想设的密码(密码长度应该有限制),Enter键,再次输入您刚才输入的密码,再次Enter键。然后按F10键,输入字母Y后回车存储结束,关机后就可以看到效果了,下次开机时,机器没有任何反应,屏幕一片空白啊,呵呵,这时输入你设置的密码再按回车键,电源立刻变亮,机器开始运行;(一定要注意,不要使用小键盘上的数字键,因为开机时,此小键盘失效)。到此,第一种密码讲解完毕

2、设置进入系统密码

按上面的方面进行bios设置菜单,进入“Advanced BIOS Features”项,然后找到把Security Option项并将其设为System(其中还有一个setup项),然后按ESC返回上一菜单,进入“Supervisor Password”项, 输入两次密码。保存重启后,就要用键盘输入密码才能完成自检的程序再进入操作系统。

好了以上就是这两种密码的设置了

下面说一下忘记了密码怎么办?有多种方法,最简单的方法是打开机箱,把那个小电池拔下,然后找个金属片或金属丝把里面的两极相连,这就是所谓的放电,这样就可设置的bios恢复到出厂时的情况,也就是类似于手机上的恢复没默认设置。

Don't just stand there 八月 5th, 2010

                                       ------Michale lee

    Most people think that they have to accept whatever life throws at them,they will say,this is my fate,my destiny ,I can not change.

     Of course not.

      You don't have to suffer needlessly,your destiny depends on you,not on any other external factors.

       I know someone who says that she accepts what life gives her because she has done everything she can improve it.

       Guess what her life style is?

       She wakes up in the morning,goes to work,comes back home,relaxes,chats with people,watches TV,then goes to sleep,next day ,the same routine cycle ensues.

      Huh,huh! is this what she calls "doing her best"?

      She believes that she has tried her best and just accept in her heart that this is the life that God has intended for her to live,that her luck can only change if God wills it.

      Of course,God wants us happy and live our life to the fullest,but we have to do our share of exerting the effort to the live life of our dreams.

     You reap what you sow.

      You just don't sit around, and wait for a million dollars to fall from the sky,you have to get off the couch ,get your eyes off the TV screen,get your hands off the phone(unless it contribute to your success),and get your mind and body to work.

       If your life is not meant the way you want it to be,don't just say:"our time will come" or "things will get better someday"

       Don't expect your luck to change ,unless you do something about it. If something goes wrong,don't regard it as temporary setback,but use it as feedback.Learn your lesson,make the most of the situation and do something to resolve problems.

      It is not enough to think positive,you also have to act positive.

      If someone'life is in trouble,do you just hope and pray that things will turn out fine?of course not,you got to anything you can to save the person.

     So it is with your own life, it is not enough to hope for your best,you have to do your best.

     In other words,Don't just sit(stand) there,do something to improve your life!

由于特定需求,最近实验室需要远程连接外地的sql server 2000服务器,最开始怎么连也连不上,出现了很多问题,但是在今天上午,借用实验室的测试条件(一个公网IP,两个教育网静态IP),终于调试通过,也算是完成了老师的任务,在这里写下自己的心得,参考了很多网上的文章和论坛里的问题,希望对有此需要的有帮助。不完善之处,也请留言。废话少说,进入主题。 

步骤: 
一 看ping 服务器IP能否ping通。 
  这个实际上是看和远程sql server 2000服务器的物理连接是否存在。如果不行,请检查网络,查看配置,当然得确保远程sql server 2000服务器的IP拼写正确。 

二 在Dos或命令行下输入telnet 服务器IP 端口,看能否连通。 
如telnet 202.114.100.100 1433 
通常端口值是1433,因为1433是sql server 2000的对于Tcp/IP的默认侦听端口。如果有问题,通常这一步会出问题。通常的提示是“……无法打开连接,连接失败"。 
如果这一步有问题,应该检查以下选项。 
  1 检查远程服务器是否启动了sql server 2000服务。如果没有,则启动。 
  2 检查服务器端有没启用Tcp/IP协议,因为远程连接(通过因特网)需要靠这个协议。检查方法是,在服务器上打开开始菜单->程序->Microsoft SQL Server->服务器网络实用工具,看启用的协议里是否有tcp/ip协议,如果没有,则启用它。 
  3 检查服务器的tcp/ip端口是否配置为1433端口。仍然在服务器网络实用工具里查看启用协议里面的tcp/ip的属性,确保默认端口为1433,并且隐藏服务器复选框没有勾上。 
    事实上,如果默认端口被修改,也是可以的,但是在客户端做telnet测试时,写服务器端口号时必须与服务器配置的端口号保持一致。如果隐藏服务器复选框被勾选,则意味着客户端无法通过枚举服务器来看到这台服务器,起到了保护的作用,但不影响连接,但是Tcp/ip协议的默认端口将被隐式修改为2433,在客户端连接时必须作相应的改变。 
    4 如果服务器端操作系统打过sp2补丁,则要对windows防火墙作一定的配置,要对它开放1433端口,通常在测试时可以直接关掉windows防火墙(其他的防火墙也关掉最好)。 
  5 检查服务器是否在1433端口侦听。如果服务器没有在tcp连接的1433端口侦听,则是连接不上的。检查方法是在服务器的dos或命令行下面输入 
netstat -a -n 或者是netstat -an,在结果列表里看是否有类似 tcp  127.0.0.1 1433  listening 的项。如果没有,则通常需要给sql server 2000打上至少sp3的补丁。其实在服务器端启动查询分析器,输入 select @@version 执行后可以看到版本号,版本号在8.0.2039以下的都需要打补丁。 
    如果以上都没问题,这时你再做telnet 服务器ip 1433 测试,将会看到屏幕一闪之后光标在左上角不停闪动。恭喜你,你马上可以开始在企业管理器或查询分析器连接了。 

三 检查客户端设置 
    程序->Microsoft SQL Server -> 客户端网络使用工具。像在服务器网络实用工具里一样,确保客户端tcp/ip协议启用,并且默认端口为1433(或其他端口,与服务器端保持一致就行)。 

四 在企业管理器里或查询那分析器连接测试 
  企业管理器->右键SQlserver组->新建sqlserver注册->下一步->写入远程IP->下一步-> 选Sqlserver登陆->下一步->写入登陆名与密码(sa,password)->下一步->下一步->完成 
  查询分析器->文件->连接->写入远程IP->写入登录名和密码(sa,password)->确定 
  通常建议在查询分析器里做,因为默认情况下,通过企业管理器注册另外一台SQL Server的超时设置是4秒,而查询分析器是15秒。 
  修改默认连接超时的方法: 
    企业管理器->工具->选项->在弹出的"SQL Server企业管理器属性"窗口中,点击"高级"选项卡->连接设置->在 登录超时(秒) 后面的框里输入一个较大的数字 
    查询分析器->工具->选项->连接->在 登录超时(秒) 后面的框里输入一个较大的数字 
    通常就可以连通了,如果提示错误,则进入下一步。 

五  错误产生的原因通常是由于SQL Server使用了"仅 Windows"的身份验证方式,因此用户无法使用SQL Server的登录帐户(如 sa )进行连接。解决方法如下所示: 
   1 在服务器端使用企业管理器,并且选择"使用 Windows 身份验证"连接上 SQL Server。 
2 展开"SQL Server组",鼠标右键点击SQL Server服务器的名称,选择"属性",再选择"安全性"选项卡。 
3 在"身份验证"下,选择"SQL Server和 Windows "。 
4 重新启动SQL Server服务。(在dos或命令行下面net stop mssqlserver停止服务,net start mssqlserver启动服务,也是一种快捷的方法)。 

附注:在连接本地服务器时,通常使用的是命名管道协议(在服务器网络实用工具里可以看到启用的协议有这个),默认端口是445,因此在本地能连通是不能说明什么问题的,连接远程服务器是完全不同的协议) 

Posted in SQL | Comments(1)»

You are a beautiful person 七月 27th, 2010

                                 ----Anonymous

     I wish that I will tell every person that I meet,that he or she is beautiful person,and have them believe it.I wish I could look  them in their eyes,  and tell them of their beauty,and have them accept the words for what they truly are,the truth,plain and simple.

      You and I both know that most people will deny their beauty,expressing what their feel is modesty or humility; It is easier for us to be told that we'r talented or intelligent,our own beauty is something we don't want to face.

       You could help me to convince people of their innate beauty.You could agree with me in an effort to reinforce the message,you could give a few specifics to illustrate just what we are talking about,when we say the person is beautiful. You could reansure the person that I am not saying it to flatter or to try to win the person over or to get something out of the person.but just trying to express in words the beauty I see when I look into that person's eyes,and see the human being there.the person who gets happy and hurt and who laughs,and who cries.

        You can help me by reminding the person that beauty isn't about comparing ourselves with others,but about the part of us that shines when we love others and love life.It is not physical,and it is not spiritual ,but a tender combination of all that we are.