Tech Site & Blog Blog about technology & programming

Archive for Feb, 2010


21Feb/100

MS SQL Add User

The simplest way to add user to MySQL and grant privileges for specific database.

1. Connect to MS SQL server using MS SQL Management Studio.

2. Click on the "New query" button in the toolbar on left.

3. Create a database
Type following query and execute it:
create database DATABASE_NAME

Example:
create database MyCMS


3. Create login
create login LOGINNAME with password='PASSWORD'

Example:
create login MyCMSUser with password='abc123'


4. Create user
use DATABASE_NAME
create user USERNAME for login LOGINNAME

Example:
use MyCMS
create user MyCMSUser for login MyCMSUser


5. Grant control of the database to the created user
use DATABASE_NAME
grant control to USERNAME

Example:
use MyCMS
grant control to MyCMSUser


Executing example queries would create user MyCMSUser with password abcd123 with all privileges on database MyCMS.

Queries have to be executed from the first to the last.

If you want to find out how to create a user with MySQL read following post: MySQL Add User