如何创建SQL Server 2008的数据库
step 1.打开SQL Server Management Studiok, 在tree上右键单击New Database.
step 2.为了供网络上的客户端访问, 需要设置端口和协议, 如下:
All network protocols are installed by SQL Server Setup, but may or may not be enabled.
Use SQL Server Configuration Manager to enable or disable network protocols. The Database Engine must be stopped and restarted for the change to take effect.
To enable a server network protocol1. In SQL Server Configuration Manager, in the console pane, expand
SQL Server Network Configuration.
2. In the console pane, click
Protocols for <instance name>.
2.1 In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1, IP2, up to IPAll. One of these is for the IP address of the loopback adapter, 127.0.0.1. Additional IP addresses appear for each IP Address on the computer. Right-click each address, and then click Properties to identify the IP address that you want to configure.
2.2 If the TCP Dynamic Ports dialog box contains 0, indicating the Database Engine is listening on dynamic ports, delete the 0.
2.3 In the IPn Properties area box, in the TCP Port box, type the port number you want this IP address to listen on, and then click OK.
3. In the details pane, right-click the protocol you want to change, and then click
Enable or
Disable.
4. In the console pane, click
SQL Server Services.
5. In the details pane, right-click
SQL Server (<instance name>), and then click
Restart, to stop and restart the SQL Server service.
step 3. 更改登录方式为混合验证方式
1. 打开企业管理器,依次展开服务器组,用右键单击软件使用的服务器。
2. 在弹出的快捷菜单,执行Properties命令,出现Server Properties对话框。
单击Security标签,在Security选项框中,将“Windows Authentication mode改为“SQL Server and Windows Authentication mode
3. 设置完成后,单击“确定”按钮,系统提示重新启动服务器。
4. 单击“是”按钮,完成对身份验证模式的修改。
说明:在 Windows XP操作系统与Windows 2000操作系统下修改SQL Server 2000, 2008身份验证模式相同,但在Windows 98操作系统下,却不能通过以上方法对身份验证模式进行修改。因为在Windows 98操作系统下,安装SQL Server 2000时,系统只支持“混合模式”身份验证模式。
step 4. 如何修改SQL Server 2008 系统管理员sa的登录密码?
1. 打开企业管理器,依次展开服务器组,然后展开服务器。
2. 展开Security文件夹,单击Login,然后用右键单击或直接双击Sa,选择properties命令。
3. 弹出SQL Server authentication对话框。在SQL Server authentication密码栏,系统对sa没有默认的密码, 删除型号, 输入最新密码。
4. 单击“确定”按钮,弹出“确认密码”对话框,再输一遍登录密码。
5. 单击“确定”按钮,完成对Sa登录密码的修改。在JDBC的url中可以使用sa登陆.
PS: SQL Server 2008的连接URL和以前版本不一样,在2000中为:url="jdbc:microsoft:sqlserver://<hostname>:1433;DatabaseName=<dbname>";
在2008中为:url="jdbc:sqlserver://<hostname>:1433;DatabaseName=<dbname>".