Welcome Guest Search | Active Topics | Log In | Register

Error while configuring - Login falied for user yaf Options · View
Invent
#1 Posted : Wednesday, May 14, 2008 8:16:02 PM

Rank: YAF Forumling


Joined: 5/14/2008
Posts: 5
Hello all,

I am new to this forum. In my company we are already using YAF in production. But when we tried to configure YAF in our localhost. we are getting error "Login falied for user yaf".

Steps we did
1) we changed SQL server express 2005 edition to Mixed mode authentication.
2) We created one new user as yaf in Sql server express 2005 edition as Windows authentication mode.
2) We created new database as "invent"
3) we changed configuration files connection string as appropriate both in web.config and yafnet.config.
4) when we run the code in our localhost to configure with yaf, we are getting the error message as "login failed for user yaf" in second step.

But still we are facing the error message as popup "connection failed.Modify web.config and try again.the error message is login falied for user yaf".

Can you please suggest some recovery steps to do?

Thanks to all.
Invent
Jaben
#2 Posted : Wednesday, May 14, 2008 11:35:35 PM

Rank: YAF Head Dude



Joined: 10/10/2004
Posts: 2,946
Location: Honolulu, HI
you have to give permission to the YAF user and SQL Server to that database.
"When you are grateful, fear disappears and abundance appears”."

Invent
#3 Posted : Wednesday, May 14, 2008 11:41:09 PM

Rank: YAF Forumling


Joined: 5/14/2008
Posts: 5
Jaben wrote:
you have to give permission to the YAF user and SQL Server to that database.


Permission to the yaf user means, can you explain how to do that in server express.
When i created user as YAF i selected some of the server roles like public, setupadmin, serveradmin, sysadmin.
Should i give some other permission while creating a user?
test2005
#4 Posted : Thursday, May 15, 2008 12:17:26 AM

Rank: YAF MVP



Joined: 2/12/2005
Posts: 923
Location: Italy

One of the options (in SQL Manager Express) under user properties is to give access to specific databases. Make sure the user you have set in yaf.confog/web.config has access to the YAF DB in SQL.

.....the man in black fled across the desert..........and the gunslinger followed.....

Invent
#5 Posted : Thursday, May 15, 2008 12:36:55 AM

Rank: YAF Forumling


Joined: 5/14/2008
Posts: 5
test2005 wrote:

One of the options (in SQL Manager Express) under user properties is to give access to specific databases. Make sure the user you have set in yaf.confog/web.config has access to the YAF DB in SQL.



Yes. we gave access to specific database for yaf user. And also we specified YAF DB in yaf.config and web.config. But still we doesnt understand what we are doing wrong? In production machine also we have sql server express edition. But there its working.
test2005
#6 Posted : Thursday, May 15, 2008 1:06:43 AM

Rank: YAF MVP



Joined: 2/12/2005
Posts: 923
Location: Italy

Post your config files. Please use the CODE button to do so!!!

.....the man in black fled across the desert..........and the gunslinger followed.....

Invent
#7 Posted : Thursday, May 15, 2008 1:24:32 AM

Rank: YAF Forumling


Joined: 5/14/2008
Posts: 5
test2005 wrote:

Post your config files. Please use the CODE button to do so!!!


my Web.config file
Code:

<configuration>
    <configSections>
        <section name="yafnet" type="yaf.SectionHandler,yaf"/>
        <section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
    </configSections>
  <connectionStrings>
    <add name="CONN" connectionString="Data Source=*;Initial Catalog=New_Data;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
    <appSettings>
        <add key="EMPSEARCH_STARTYEAR" value="2004"></add>
        <add key="SqlConn" value="user id=*;password=*;Data Source=*;Initial Catalog=New_Data;Connect Timeout=360;"/>
        <add key="connstr" value="user id=yaf1;pwd=yaf1;data source=(local);initial catalog=yaf;timeout=90"/>
    </appSettings>
  <yafnet configSource="yafnet.config"/>
    <rewriter configSource="urlrewriter.config"/>
    <system.web>
        <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
        <compilation debug="true"/>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
        <authentication mode="Forms">
            <forms name=".YAFNET_Authentication" timeout="525600"/>
        </authentication>
        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
        <xhtmlConformance mode="Legacy"/>
    </system.web>
</configuration>


yafnet.config

Code:

<yafnet>
  <root>/h1data/yaf/</root>
    <connstr>user id=yaf1;pwd=yaf1;data source=(local);initial catalog=New_Data;timeout=90</connstr>
    <uploaddir>~/upload/</uploaddir>
    <boardid>1</boardid>
    <!-- Enable URL Rewriting -->
    <enableurlrewriting>false</enableurlrewriting>
    <!--logtomail>email=;server=;user=;pass=;</logtomail-->
    <!--categoryid>1</categoryid-->
    <!-- Enable these to use a custom user class "provider" -->
    <!--CustomUserAssembly>TinyGecko.YAFIntegration.dll</CustomUserAssembly>
    <CustomUserClass>TinyGecko.YAFIntegration.yafUserClass</CustomUserClass-->
</yafnet>
test2005
#8 Posted : Thursday, May 15, 2008 7:14:46 AM

Rank: YAF MVP



Joined: 2/12/2005
Posts: 923
Location: Italy
OK...several things a-miss here.

In the web.config file, this...

Code:
<add name="CONN" connectionString="Data Source=*;Initial Catalog=New_Data;Integrated Security=True" providerName="System.Data.SqlClient"/>


should read (if your running SQL EXPRESS)...

Code:

<add name="CONN" connectionString="Data Source=MYSERVERNAME\SQLEXPRESS;Initial Catalog=MY_YAF_DB_NAME;Integrated Security=True" providerName="System.Data.SqlClient"/>


and this...

Code:
<add key="SqlConn" value="user id=*;password=*;Data Source=*;Initial Catalog=New_Data;Connect Timeout=360;"/>
        <add key="connstr" value="user id=yaf1;pwd=yaf1;data source=(local);initial catalog=yaf;timeout=90"/>


should read...

Code:
<add key="connstr" value="user id=yaf1;pwd=yaf1;data source=MYSERVERNAME\SQLEXPRESS;initial catalog=yaf;timeout=90"/>


In your yafnet.config, same problem. This...

Code:
<connstr>user id=yaf1;pwd=yaf1;data source=(local);initial catalog=New_Data;timeout=90</connstr>


should read....

Code:
<connstr>user id=yaf1;pwd=yaf1;data source=MYSERVERNAME\SQLEXPRESS;initial catalog=YAFDBNAME;timeout=90</connstr>


Download and install the SQL Server Management Studio Express (it's free) which will allow you to, funny enough, manage your databases.

When you first start this program, the "connect to server" window will appear. You server name is in the "Server Name" box. If you running Express version, you need to append "\EXPRESS" to the end of this for the connection to work.

If all else fails, on your PC, go to Control Panel>Administraive Tools>Data Sources (ODBC). Click on SYstem DSN and click "ADD". Scroll down to "SQL Server" and click "Finish". In the next box, enter "test" in block 1, "test" in block 2 then select your server from the thrid box and click "Next", CLick "Next" again. Check the "change the default database to:" dropdown to the YAF database and click "Next". Click "Finish" and when the confirm window apears click "Test Data Source". If you get a "successful" message, click "OK".

Now, do this all over again, except this time, in the second window change the authentication from Windows to SQL Server and enter you username and password. Step through everything to the end and test the connection. If it fails, your SQL User does not have permissions to do what needs doing!

Go into SQLSMSE expand "your server">databases>"YAFDB">security>users and right click the user and increase the permissions. If you user is not there, add them.

HTH

Razz
.....the man in black fled across the desert..........and the gunslinger followed.....

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 RC2 | YAF © 2003-2008, Yet Another Forum.NET
This page was generated in 0.098 seconds.

SourceForge.net Logo Powered by ASP.NET v2.0 411ASP.NET