Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 58 lines (52 sloc) 3.821 kb
2df7f31 @radar Fixed broken links and improved controllers page.
radar authored
1 <html>
2 <head>
3 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
4 <link href="files/style.css" media="screen" rel="stylesheet" type="text/css">
5 <link href="files/twilight.css" media="screen" rel="stylesheet" type="text/css">
6 </head>
7 <body>
8 <div align="center">
9 <div id="flash" style="display: none;"></div>
10 <table id="everything" cellpadding="0" cellspacing="0" width="98%">
11 <tbody>
12 <tr>
13 <td id="left">&nbsp;</td>
14 <td class="content">
15 <img alt="Logo" id="logo" src="files/logo.jpg"><br><br><br><br><br>
16 <span id="fr"><a href="models.html">Models »</a></span>
17 <span id="fl"><a href="index.html">« Introduction</a></span>
18 <br><br>
19 <h2>Database</h2>
20 <p>As of Rails 2.0.2, Rails supports SQLite as the default database,
21 and if you're using SQLite you won't need to edit the database.yml
22 file. If you're one of the brave souls using an alternative, you might
23 want to edit your <span class="term">config/database.yml</span> to look like this:</p>
24
25 <p><strong class="code-title">config/database.yml</strong>
26 </p><pre class="twilight"><span class="line-numbers"> 1 </span> <span class="MetaTagAll"><span class="MetaTagInline">development</span><span class="MetaTagAll">:</span></span>
27 <span class="line-numbers"> 2 </span> <span class="String"><span class="MetaTagInline">username<span class="MetaTagInline">:</span></span> <span class="String">root</span></span>
28 <span class="line-numbers"> 3 </span> <span class="String"><span class="MetaTagInline">password<span class="MetaTagInline">:</span></span> <span class="String">password</span></span>
29 <span class="line-numbers"> 4 </span> <span class="String"><span class="MetaTagInline">database<span class="MetaTagInline">:</span></span> <span class="String">forum</span></span>
30 <span class="line-numbers"> 5 </span> <span class="String"><span class="MetaTagInline">adapter<span class="MetaTagInline">:</span></span> <span class="String">mysql</span></span>
31 <span class="line-numbers"> 6 </span> <span class="MetaTagAll"><span class="MetaTagInline">socket</span><span class="MetaTagAll">:</span> </span>/var/run/mysqld/mysqld.sock
32 <span class="line-numbers"> 7 </span>
33 <span class="line-numbers"> 8 </span> <span class="MetaTagAll"><span class="MetaTagInline">test</span><span class="MetaTagAll">:</span></span>
34 <span class="line-numbers"> 9 </span> <span class="String"><span class="MetaTagInline">adapter<span class="MetaTagInline">:</span></span> <span class="String">sqlite</span></span>
35 <span class="line-numbers"> 10 </span> <span class="String"><span class="MetaTagInline">database<span class="MetaTagInline">:</span></span> <span class="String">db/test.sqlite3</span></span>
36 </pre><p></p>
37
38 <p>This file is written in a format known as YAML (Yet Another Markup
39 Language) and works similarly to Ruby hashes, with the key coming first
40 and then the value after the <span class="term">:</span>. In fact if you were to use the `</p>
41
42 <p>with obviously 'root' and 'password' replaced with your actual
43 username and password for MySQL. Postgres users will need to specify <span class="term">postgresql</span> as their adapter, and <em>/tmp/pgsql.5432</em> as their socket. Windows users do not need to specify a socket for either.</p>
44
45 <p>Using SQLite means that it'll store the database along with the
46 Rails application in the db folder as a file. Nobody else should have
47 access to this file unless you specifically give them access to it, so
48 it's secure also.</p>
49 <br><br>
50
51 <span id="fr"><a href="models.html">Models »</a></span>
52 <span id="fl"><a href="index.html">« Introduction</a></span>
53
54 </td><td id="right">&nbsp;</td></tr>
55 <tr><td colspan="3" id="bottom">&nbsp;</td></tr>
56 </tbody></table>
57 </div>
58 </body></html>
Something went wrong with that request. Please try again.