Archive for category Windows
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
25Sep/092
WordPress on IIS7
How to use WordPress blog's permalinks with IIS7 (or similar Content Management Systems)?It's really simple to make this work on Apache server. Just copy 5 lines of code to .htaccess file.
But it's a little bit harder to do so on IIS7. You have 2 options:
- use IIS7 GUI to create rules
- modify Web.Config by hand
Code for Web.Config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="RewriteUserFriendlyURL1" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Explanation:
1. IIS tries to match requested url with * (everything).
2. If match is found, IIS checks if there is a file with the same url that is requested.
3. Then IIS checks if there is a directory with that name.
4. If there is no file/directory with that name, IIS rewrites url to "index.php".