YAFLogo

wgytsh
  • wgytsh
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
9 years ago
New user here, don't know how to setup database yafnet.

Thanks

Yan

Sponsor
Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
9 years ago
Unless I am not understanding your inquiry, the setting up of the database is done by YAF during the install. When you run the install wizard from /forum/install it sets it up for you. You will have to enter in the proper values into the db.config connection string.
wgytsh
  • wgytsh
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
9 years ago
So you mean I need firstly run the installer to set up the database and then debug the source code?
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
9 years ago

So you mean I need firstly run the installer to set up the database and then debug the source code?

Originally Posted by: wgytsh 

Yes even if you want to debug you need to install first.

GBarnas
  • GBarnas
  • 52.4% (Neutral)
  • YAF Forumling
9 years ago
In Step 3 of the instructions - set up the database, there could be a bit more info to help beginners.. Just a few steps are needed on the SQL server.

Install SQL Server software - this can be on the same server as IIS/YAF or a different server. If it is on a different server, you will either need to disable the firewall on the SQL server or make sure that the SQL install process updates the rules to allow network SQL connections. Neglecting this can cause hours of wasted effort!

On the SQL Server, open the SQL management console and create a New Database - I called mine "YAF-web_site_name". Browse down the SQL management tree to Security\Logins and create a user (YAF-WEB, for example). Now go back to your YAF-web_site_name database and expand Security\Users. Right-click on Users and choose New User. Type the name of the user (YAF-WEB) into the User Name, then click the browse button next to the Login Name field. Type the name into the input field and click Check Name, then OK. On the User's info screen, click the Owned Schemas object and select "db_owner". Do the same on the Membership object and click OK. The database is now set up and ready for use. In production, you'd come back and reduce these permissions appropriately after install, but for during the install and dev platforms, this is fine.

Next, edit the db.config file found in the root of the YAF site folder. This contains example connection strings. I am using a remote database and created the following entry, and made sure all others were removed or commented-out:

<add name="yafnet" connectionString="Data Source=sqlserver01;Initial Catalog=YAF-web_site_name;Persist Security Info=True;User ID=YAF-WEB;Password=P@ssw0rd" providerName="System.Data.SqlClient" />
This was done following the example in the file and customized for my configuration. If your SQL and IIS are on the same box, your Data Source will be "(local)" instead of the SQL server name. The "Initial Catalog" is the name of the database you created. "Name" can remain "yafnet" as it's just a description used internally.

At this point, I continued with steps 4-6 of the installation. When I logged in and started the initial configuration, I was able to test the SQL connection - this great feature allows you to correct the settings in the db.config file and test again before continuing with the install.

Glenn