You are on page 1of 23

 MS SQL Server 2005 Express Edition   LAN (Step-by-Step

) 

    MS SQL Server 2005 Express Edition   
 ! LAN  "  #
 % &" '  
( ")           *  ,  Download
MS SQL Server 2005 Express Edition !- Components . ,/ 
 .NET framework 2.0 !   %  

/    ,   
 "   )  ,/     Next

 Install 
/   ,   //  
%   next  

 %)3 Installation Wizard  Next 
 ,    Components . ,/ #  ! ')" ! 
/ download
 

#  #, Hardware minimun requirements 
Next   #   ,

 # 3  %   Next " 
),#4 #   " 5 # 
  " % check box    
"   "6  "     # default #6/ # 
 , LAN #     Next   

""  ,
'  / ,"     ## 
&-!"    %    % !/ DB Server ,
 , Development 
   Next 3)/ 

  ,  , 
Instance Name ) Database Server    ! , 
Instance Name 
'  " Default Instance   "   % #   
  "6 Instance Name
% /  %   Next #  

'/   # default ) service account "
 Service 
 , 
Network Service / Local System #    Next
),#4 ) 
- #  , 

/ Mixed Mode  " ! connect 
# )   User Name  " Password  7,
# )  

  
 "4 User ) Active Directory Domain Controller 
 , 
Password ,
 sa    Next

 Next  #  # default ,
85  
" 
 Next /

Microsoft )  3)3    "#  " " )    Next 
6  % 6/"" /   .     Enterprise Edition
 Install  #    
 

)   6 #  
%   Next  

6/ " %" 
  3"#  " !
%  Finish  # !"#  "  , 

% "  !' LAN #   ,"   #67 !))
!  33 !- 3 Services , 
  

(3 %#   3 SQL Service 
    3  port 1433  - 3  
"  / Service '/ Command Prompt    netstat -an | find /i "listen"    enter

 . netstat -an | find /i "1433" ")-" 

 ,  # / Start menu   SQL Server 2005 Surface Area Configuration 
6 MS SQL Server 2005 

//     " 
/   % 3"/ ,"   
 !' LAN  
/   
 / "  #       # Surface Area Configuration for Services
and Connections # :  
Tree &   Remote Connections  #  
) %"/  
  
## Local connections only ( ,
  ! ' LAN ) 

  # 

   Local and remote connections    

  Using TCP/IP only "#   name pipes )  ,/  "" ,
)3 
# )   / 
  LAN  3  # TCP/IP %     "  Apply 
  OK "#, 
 restart -"' / " ,  Restart SQL Service 

#67 ,  restart SQL Service ( #67!  ')",
 3 /   

SQL Service Manager  SQL Server 2000 # //   SQL Server Configuration Manager 
&   SQL Server 2005 Services )  SQL Server   /6 restart  !#  
  # 3 % % 
, % 6 ) '  #67 % !  #67 ! "/   % 
 Query Analyser, Server Explorer  Visual Studion  ".  "#  
  
-  ! # Enterprise manager ) MS SQL Server 2000
')",
 SQL Server Management Studio #   ,
 Express  &-
Download #   ' %   Service ) SQL Server Express  
,    
  
/ Command Prompt   #,
netstat -an -p tcp | find /i "listening"  
  ) port 1433
! % ,     

*-#  ,
 command netstat #67 !/  arguments "#  
 netstat -an -p tcp | find /i "1433"   ' %# "  #' ( 1   
#  ,
   SQL Server Express Edition 
 ! ,/ Database Server  LAN 
  ,#4 . 3  #
1. Mixed Mode authentication &- " ,
 /4 
  ' 
2. Server  " Instance Name   
!3  "
3.  ,  #/
 !'# ) 

  !3  ""  "    # default 
# )8 
 " SQL Server Express  # 

/  
 #  >" Database Engine  

**#67 !#  Client Tools  % #67!   
/  
  SQL
CLient    #67 !  ODBC Connection )-    # ' %#  

" % Enterprise Manager ) MS SQL Server 2000  ! )  SQL Server 05  
" " Message  7   MS SQL Server Management Studio  Version 3

 MS SQL Server Management studio Express / #    #  
! Download  *   %) Microsoft Downloads  link  # 
Download SQL Server Management Studio Express
** ,))#67   /4 
   MS SQL Server 2005 Express Edition   
#  3 (remote connections)  
 ,)
    

http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277

 ( /) 
-#   

%  

Create exceptions in Windows Firewall
These steps apply to the version of Windows Firewall that is included in Windows XP Service Pack 2 (SP2)
and in Windows Server 2003. If you are using a different firewall system, see your firewall documentation
for more information.

If you are running a firewall on the computer that is running SQL Server 2005, external connections to SQL
Server 2005 will be blocked unless SQL Server 2005 and the SQL Server Browser service can communicate
through the firewall. You must create an exception for each instance of SQL Server 2005 that you want to
accept remote connections and an exception for the SQL Server Browser service.

SQL Server 2005 uses an instance ID as part of the path when you install its program files. To create an
exception for each instance of SQL Server, you must identify the correct instance ID. To obtain an instance
ID, follow these steps:

Click Start , point to Programs , point to Microsoft SQL Server 2005 , point to Configuration
1.
Tools , and then click SQL Server Configuration Manager .
In SQL Server Configuration Manager, click the SQL Server Browser service in the right pane, right-click
2.
the instance name in the main window, and then click Properties .
On the SQL Server Browser Properties page, click the Advanced tab, locate the instance ID in
3.
the property list, and then click OK .
To open Windows Firewall, click Start , click Run , type firewall.cpl, and then click OK .
Create an exception for SQL Server 2005 in Windows Firewall
To create an exception for SQL Server 2005 in Windows Firewall, follow these steps:
1. In Windows Firewall, click the Exceptions tab, and then click Add Program .
2. In the Add a Program window, click Browse .
Click the C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe executable program,
click Open , and then click OK .
3.
Note The path may be different depending on where SQL Server 2005 is installed. MSSQL.1
is a placeholder for the instance ID that you obtained in step 3 of the previous procedure.
4. Repeat steps 1 through 3 for each instance of SQL Server 2005 that needs an exception.
Create an exception for the SQL Server Browser service in Windows Firewall
To create an exception for the SQL Server Browser service in Windows Firewall, follow these
steps:

1. In Windows Firewall, click the Exceptions tab, and then click Add Program .
2. In the Add a Program window, click Browse .
Click the C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe executable program, click
Open , and then click OK .
3.
Note The path may be different depending on where SQL Server 2005 is installed. 
( /   6// 85 "#  

 MS SQL Server 2005   
 ,  64
  !' Firewall 
#,", ,
 Windows Firewall 
 Personal Firewall   ! # 
   # 
# ,  64 SQL Server 
     
,  64 
 
Instance   
 ,  64
#  6 .#   " Instance " 
Path ) /    >" 
    
- , 

#  


 ,  
 Instance ID   

" ! "6 path ) SQL Instance 
1. 
 / Start > Program > MS SQL Server 2005 > Configuration Tools > SQL Server
Configuration Manager.
2. 
 &   SQL Server 2005 Services    )   Instance   
 Click
)   Properties   -  Advanced Tab    
Instance ID   " 
Instance ID # MSSQL.1 
  OK  /  # ) Firewall  
  # Windows Firewall ,
 SQL Server 2005 Services

1. / Windows Firewall  Control Panel

 Start > Run    firewall.cpl    OK    
 Windows Firewall
2.  " # 64
 MS SQL Server   
        Exceptions 
 // 
Tab Exceptions 
 , /6 Add program " 
  Add a program 
  Browser  "6 Path
) /   )/
3. "6 Path / "7#  C:\Program Files\Microsoft SQL Server\[Instance ID]\MSSQL\Binn\sqlservr.exe 
 C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe
*,
 Instance  ,  Add Program  
 #  #  

  # Windows Firewall ,
 SQL Server 2005 Browser Services
* 
#67 SQL Server  Instance name ,/ /  # 
1. ,) #  #  # Add Program  Exceptions  Path " 

2. "6 Path #  C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe 

/  
  OK /  %# 

**  /   Security Authentication Mode ) SQL Server   ! , "#  

# )/  /(   @ Management Studio Connect   Windows
Authentication   3 6 Administrator )# 
  Role Sysadmin ) SQL Server #  
,  /   Security Authentication Mode   " ,  , 
password ,
 sa  #  

 ! login )  " % !   login   #   


1. / SQL Server Management Studio   Server Instance   # : )   Properties.

2.   
 Security 
3  Server authentication %   SQL Server and Authentication Mode  
# : OK   " 

 Restart -"'

3. ,  Restart    Mouse   Server Instance   # : )   Restart #  " 
! %
YES # 3 
- % 
% #  

       Login ) SQL Server  "#  
 login  
- # sa      , 
password  " Disable  3  / , 
password 
" Enable 

 "/  Login ) )-

4. !#   New Query #  " 
 ). 

  #, SQL
5.  SQL Statement # 

ALTER LOGIN sa ENABLE ;
GO
ALTER LOGIN sa WITH PASSWORD = '<password>' ;
GO

6.  /6 F5  
#, , %" 
    , %
 

% "#   
 , @ Management Studio "#  #   !)    
"    !  Management Studio %  
 ! 
 % @ (  )/ 
 Registry "#  

 # 
**" (SQL Server Management Studio   SQL Server Management Studio Express ) ! 
 "# $%    Registry &" 

" %/ /  
(# Sql authentication & uninstall SQL Epress 2005 # 
http://www.greatfriends.biz/?16751 

)  /   SQL Security Mode   )/ ) Registry    
) ,
# 

) 
/ Registry Editor
 Start > Run > regedit [OK] 

   Tree )/ Path 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\ 

 " Instance ) SQL Server  3 ! 
Instance %"   

   !-
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer 
  ) 
3  Subkey
LoginMode 
# // ## 
#
1 - Windows Authentication Mode
2 - SQL Server Security Mode And Windows Authentication Mode 

 , 
# 
/ 1
 2  Mode   "#  
 / 

 
 ,  Restart #  1 #  

/  % "#  ,
  /   Security Mode     Registry
*    ! login ) SQL Server  Windows Authentication Mode  "#  

    #  /  sa login
   Login  
   "#  

 ,)  3 ) Reply 15 / sa Login "#  

,
    Account  
 % ,  #   /   SQL Staement # 

USE MASTER
sp_addLogin 'mie', 'secure_password_for_mie'
GO
sp_addsrvrolemember 'mie', 'sysadmin'
GO
USE MYDATABASE
EXEC sp_adduser 'mie' 

"#  
  %   # Firewall   Antivirus ( " Firewall  "/ Firewall) 
/    
 

% "  !' LAN #   ,"   #67 !))
!  33 !- 3 Services , 
  

(3 %#   3 SQL Service 
    3  port 1433  - 3  
"  / Service '/ Command Prompt    netstat -an | find /i "listen"    enter

 . netstat -an | find /i "1433" ")-" 

 ,  # / Start menu   SQL Server 2005 Surface Area Configuration 
6 MS SQL Server 2005 

//     " 
/   % 3"/ ,"   
 !' LAN  
/   
 / "  #       # Surface Area Configuration for Services
and Connections # :  
Tree &   Remote Connections  #  
) %"/  
  
## Local connections only ( ,
  ! ' LAN ) 

  # 

   Local and remote connections    

  Using TCP/IP only "#   name pipes )  ,/  "" ,
)3 
# )   / 
  LAN  3  # TCP/IP %     "  Apply 
  OK "#, 
 restart -"' / " ,  Restart SQL Service 

#67 ,  restart SQL Service ( #67!  ')",
 3 /   

SQL Service Manager  SQL Server 2000 # //   SQL Server Configuration Manager 
&   SQL Server 2005 Services )  SQL Server   /6 restart  !#  
  # 3 % % 
, % 6 ) '  #67 % !  #67 ! "/   % 
 Query Analyser, Server Explorer  Visual Studion  ".  "#  
  
-  ! # Enterprise manager ) MS SQL Server 2000
')",
 SQL Server Management Studio #   ,
 Express  &-
Download #   ' %   Service ) SQL Server Express  
,    
  
/ Command Prompt   #,
netstat -an -p tcp | find /i "listening"  
  ) port 1433
! % ,     

*-#  ,
 command netstat #67 !/  arguments "#  
 netstat -an -p tcp | find /i "1433"   ' %# "  #' ( 1    

# "# 

  ,#4 . 3  #
1. Mixed Mode authentication
2. Server  " Instance Name   
!3  "
3.  ,  #/
 !'# )  ( Windows Firewall Configuration + Antivirus
Firewall)