The following describes how to setup a database user with read-only access to the AdventureWorks database.

Using SQL Server Management Studio 2008:

  1. Connect to your database server.
  2. Expand Security > Logins.
  3. Right-click on the user who will be set as having read-only access (in this example "adventureworksro").
  4. Select Properties.
  5. Select User Mapping.
  6. Map the login to the database they will have access to.
  7. Tick the boxes for role membership next to public and db_datareader.
  8. Confirm by clicking OK.
You should get something like the following:
Login Properties - Adventureworksro

Download Connectors from

MySQL Connector/Net

Type: .NET Framework Class Library
Usage: MySql.Data.MySqlClient.MySqlConnection
Manufacturer: MySQL

  1.  Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; 
Default port is 3306.

Specifying port
  1.  Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword; 

This is an article on how to do a restore from backup on a database but when you get the error: "... database is in use".

  1.  -- SQL Server 2005 
  2.  EXEC SP_WHO          // details on who is logged in 
  3.  GO 
  5.  -- SQL Server 2008 
  6.  EXEC SP_WHO2         // even more details 
  7.  GO 
  9.  -- Run as database owner to see ALL connected processes as well. 

For every DBA this is a doddle and doesn't warrant its own article but for those of us who merely use SQL Server Management Studio (SSMS) and Microsoft's SQL Server 2008 R2 for development purposes, the once-in-a-blue-moon restore from backup process is quickly forgotten.

You need to set the database to single-user mode.