<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Changes to UsingMySQLAsDataBackend</title>
    <description/>
    <link>http://www.motiro.org/en-us</link>
    <language>en-us</language>
    <generator>Motiro</generator>
    <pubDate>Wed, 27 Aug 2008 12:18:48 -0400</pubDate>
    <ttl>60</ttl>
<item><title>Using MySQL as Data Backend</title><description>&lt;p&gt;Before starting, make sure that the MySQL database server is correctly
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/installing.html"&gt;installed&lt;/a&gt; and
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/post-installation.html"&gt;running&lt;/a&gt;. The
process described here was tested for version 4.1, but is likely to work on
other versions too.&lt;/p&gt; &lt;h2&gt;&lt;a name='TCP_Connection'&gt;&lt;/a&gt; TCP Connection &lt;/h2&gt; &lt;p&gt;
Motiro tries to connect to the MySQL server using a TCP socket. You will need
to make sure the server is up and listening for connections on port 3306
(MySQL default port). If you're not sure, try issuing the command&lt;/p&gt; &lt;p&gt;&lt;pre&gt;% telnet localhost 3306&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;The output should look something like&lt;/p&gt; &lt;p&gt;&lt;pre&gt;
7
&amp;lt;code&amp;gt; 4.1.18-nt&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;       xH?@cU]S,&#65533;!?h3d{bUf~jv5A&amp;lt;/code&amp;gt;&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;You may need to set up your MySQL server to accept TCP connections, if you
are sure the server is running and it doesn't respond to the above command.
You may also set up your MySQL server to answer only to connections
originated from the localhost, if you feel opening the port is a security
issue. For more information, please see the
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/index.html"&gt;MySQL user guide&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;&lt;a name='Database_creation'&gt;&lt;/a&gt; Database creation &lt;/h2&gt; &lt;p&gt;
Motiro uses the empty-passworded username 'motiro' to authenticate to the
MySQL server. It may need to access three differente databases, depending on
the execution context. The database names are&lt;/p&gt; &lt;ul&gt;&lt;li&gt; motiro_development: for development and initial test purposes&lt;/li&gt;&lt;li&gt; motiro_test: for automatic testing purposes&lt;/li&gt;&lt;li&gt; motiro_production: for real-life usage&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;
You will need to make sure those databases are present and fully-acessible
to the user motiro. The following script will do the trick. It is a
command-line script using the mysql client, but you may use any tool you'd
prefer (maybe a GUI or web-based one). Just make sure to create the
databases with the exact names and to grant all privileges to the motiro
user in them.&lt;/p&gt; &lt;p&gt;To use the mysql client just fire it as the root user and say (lines
starting with '%' are commands to my shell and with 'mysql&amp;gt;' are to the
MySQL database, others are the system responses to them):&lt;/p&gt; &lt;p&gt;&lt;pre&gt;
% mysql -u root -p
Enter password: ***********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 4.1.18-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&amp;gt; create database motiro_development;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; create database motiro_test;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; create database motiro_production;
Query OK, 1 row affected (0.02 sec)

mysql&amp;gt; grant all on motiro_development.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; grant all on motiro_test.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; grant all on motiro_production.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; exit
Bye&lt;/pre&gt;&lt;/p&gt; &lt;h2&gt;&lt;a name='Point_to_MySQL'&gt;&lt;/a&gt; Point to MySQL &lt;/h2&gt; &lt;p&gt;
The file &lt;code&gt;config/database.yml&lt;/code&gt; is the one that points to the
database backend that Motiro should user. The default setup right now is
to use SQLite 3. In order to use you newly-created MySQL databases,
change the file contents for what you see below.&lt;/p&gt; &lt;pre&gt;  development:
    adapter: mysql
    database: motiro_development
    host: 127.0.0.1
    port: 3306
    username: motiro
    password:&lt;/pre&gt; &lt;pre&gt;  test:
    adapter: mysql
    database: motiro_test
    host: 127.0.0.1
    port: 3306
    username: motiro
    password:&lt;/pre&gt; &lt;pre&gt;  production:
    adapter: mysql
    database: motiro_production
    host: 127.0.0.1
    port: 3306
    username: motiro
    password:&lt;/pre&gt; &lt;h2&gt;&lt;a name='Preparing_the_schema'&gt;&lt;/a&gt; Preparing the schema &lt;/h2&gt; &lt;p&gt;
Last step for setting your databases is setting up their schemas correctly.
Fortunately, Motiro comes prepackaged with migration scripts for this
purpose. You will need to ask rake to run them.&lt;/p&gt; &lt;p&gt;&lt;pre&gt;% rake migrate&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;This last step is exactly the same thing that should be done for the default
set up. From now on you can refer to the &lt;a href="http://www.motiro.org/wiki/show/Installation"&gt;main instructions&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 27 Aug 2008 12:18:48 -0400</pubDate><dc:creator>thiagoarrais</dc:creator><guid>http://www.motiro.org/wiki/show/UsingMySQLAsDataBackend?revision=5</guid></item><item><title>Using MySQL as Data Backend</title><description>&lt;p&gt;Before starting, make sure that the MySQL database server is correctly
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/installing.html"&gt;installed&lt;/a&gt; and
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/post-installation.html"&gt;running&lt;/a&gt;. The
process described here was tested for version 4.1, but is likely to work on
other versions too.&lt;/p&gt; &lt;h2&gt;&lt;a name='TCP_Connection'&gt;&lt;/a&gt; TCP Connection &lt;/h2&gt; &lt;p&gt;
Motiro tries to connect to the MySQL server using a TCP socket. You will need
to make sure the server is up and listening for connections on port 3306
(MySQL default port). If you're not sure, try issuing the command&lt;/p&gt; &lt;p&gt;&lt;pre&gt;% telnet localhost 3306&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;The output should look something like&lt;/p&gt; &lt;p&gt;&lt;pre&gt;
7
&amp;lt;code&amp;gt; 4.1.18-nt&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;       xH?@cU]S,&#65533;!?h3d{bUf~jv5A&amp;lt;/code&amp;gt;&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;You may need to set up your MySQL server to accept TCP connections, if you
are sure the server is running and it doesn't respond to the above command.
You may also set up your MySQL server to answer only to connections
originated from the localhost, if you feel opening the port is a security
issue. For more information, please see the
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/index.html"&gt;MySQL user guide&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;&lt;a name='Database_creation'&gt;&lt;/a&gt; Database creation &lt;/h2&gt; &lt;p&gt;
Motiro uses the empty-passworded username 'motiro' to authenticate to the
MySQL server. It may need to access three differente databases, depending on
the execution context. The database names are&lt;/p&gt; &lt;ul&gt;&lt;li&gt; motiro_development: for development and initial test purposes&lt;/li&gt;&lt;li&gt; motiro_test: for automatic testing purposes&lt;/li&gt;&lt;li&gt; motiro_production: for real-life usage&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;
You will need to make sure those databases are present and fully-acessible
to the user motiro. The following script will do the trick. It is a
command-line script using the mysql client, but you may use any tool you'd
prefer (maybe a GUI or web-based one). Just make sure to create the
databases with the exact names and to grant all privileges to the motiro
user in them.&lt;/p&gt; &lt;p&gt;To use the mysql client just fire it as the root user and say (lines
starting with '%' are commands to my shell and with 'mysql&amp;gt;' are to the
MySQL database, others are the system responses to them):&lt;/p&gt; &lt;p&gt;&lt;pre&gt;
% mysql -u root -p
Enter password: ***********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 4.1.18-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&amp;gt; create database motiro_development;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; create database motiro_test;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; create database motiro_production;
Query OK, 1 row affected (0.02 sec)

mysql&amp;gt; grant all on motiro_development.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; grant all on motiro_test.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; grant all on motiro_production.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; exit
Bye&lt;/pre&gt;&lt;/p&gt; &lt;h2&gt;&lt;a name='Point_to_MySQL'&gt;&lt;/a&gt; Point to MySQL &lt;/h2&gt; &lt;p&gt;
The file &lt;code&gt;config/database.yml&lt;/code&gt; is the one that points to the
database backend that Motiro should user. The default setup right now is
to use SQLite 3. In order to use you newly-created MySQL databases,
change the file contents for what you see below.&lt;/p&gt; &lt;p&gt;&lt;span style="background: #ffb8b8"&gt;&lt;pre&gt;
development:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_development&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password:&amp;lt;/code&amp;gt;

test:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_test&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password:&amp;lt;/code&amp;gt;

production:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_production&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password: &amp;lt;/code&amp;gt;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style="background: #b8ffb8"&gt;  development:
    adapter: mysql
    database: motiro_development
    host: 127.0.0.1
    port: 3306
    username: motiro
    password:&lt;/span&gt;&lt;/pre&gt; &lt;pre&gt;&lt;span style="background: #b8ffb8"&gt;  test:
    adapter: mysql
    database: motiro_test
    host: 127.0.0.1
    port: 3306
    username: motiro
    password:&lt;/span&gt;&lt;/pre&gt; &lt;pre&gt;&lt;span style="background: #b8ffb8"&gt;  production:
    adapter: mysql
    database: motiro_production
    host: 127.0.0.1
    port: 3306
    username: motiro
    password:&lt;/span&gt;&lt;/pre&gt; &lt;h2&gt;&lt;a name='Preparing_the_schema'&gt;&lt;/a&gt; Preparing the schema &lt;/h2&gt; &lt;p&gt;
Last step for setting your databases is setting up their schemas correctly.
Fortunately, Motiro comes prepackaged with migration scripts for this
purpose. You will need to ask rake to run them.&lt;/p&gt; &lt;p&gt;&lt;pre&gt;% rake migrate&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;This last step is exactly the same thing that should be done for the default
set up. From now on you can refer to the &lt;a href="http://www.motiro.org/wiki/show/Installation"&gt;main instructions&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 27 Aug 2008 12:17:49 -0400</pubDate><dc:creator>thiagoarrais</dc:creator><guid>http://www.motiro.org/wiki/show/UsingMySQLAsDataBackend?revision=4</guid></item><item><title>Using MySQL as Data Backend</title><description>&lt;p&gt;Before starting, make sure that the MySQL database server is correctly
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/installing.html"&gt;installed&lt;/a&gt; and
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/post-installation.html"&gt;running&lt;/a&gt;. The
process described here was tested for version 4.1, but is likely to work on
other versions too.&lt;/p&gt; &lt;h2&gt;&lt;a name='TCP_Connection'&gt;&lt;/a&gt; TCP Connection &lt;/h2&gt; &lt;p&gt;
Motiro tries to connect to the MySQL server using a TCP socket. You will need
to make sure the server is up and listening for connections on port 3306
(MySQL default port). If you're not sure, try issuing the command&lt;/p&gt; &lt;p&gt;&lt;pre&gt;% telnet localhost 3306&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;The output should look something like&lt;/p&gt; &lt;p&gt;&lt;pre&gt;
7
&amp;lt;code&amp;gt; 4.1.18-nt&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;       xH?@cU]S,&#65533;!?h3d{bUf~jv5A&amp;lt;/code&amp;gt;&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;You may need to set up your MySQL server to accept TCP connections, if you
are sure the server is running and it doesn't respond to the above command.
You may also set up your MySQL server to answer only to connections
originated from the localhost, if you feel opening the port is a security
issue. For more information, please see the
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/index.html"&gt;MySQL user guide&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;&lt;a name='Database_creation'&gt;&lt;/a&gt; Database creation &lt;/h2&gt; &lt;p&gt;
Motiro uses the empty-passworded username 'motiro' to authenticate to the
MySQL server. It may need to access three differente databases, depending on
the execution context. The database names are&lt;/p&gt; &lt;ul&gt;&lt;li&gt; motiro_development: for development and initial test purposes&lt;/li&gt;&lt;li&gt; motiro_test: for automatic testing purposes&lt;/li&gt;&lt;li&gt; motiro_production: for real-life usage&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;
You will need to make sure those databases are present and fully-acessible
to the user motiro. The following script will do the trick. It is a
command-line script using the mysql client, but you may use any tool you'd
prefer (maybe a GUI or web-based one). Just make sure to create the
databases with the exact names and to grant all privileges to the motiro
user in them.&lt;/p&gt; &lt;p&gt;To use the mysql client just fire it as the root user and say (lines
starting with '%' are commands to my shell and with 'mysql&amp;gt;' are to the
MySQL database, others are the system responses to them):&lt;/p&gt; &lt;p&gt;&lt;pre&gt;
% mysql -u root -p
Enter password: ***********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 4.1.18-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&amp;gt; create database motiro_development;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; create database motiro_test;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; create database motiro_production;
Query OK, 1 row affected (0.02 sec)

mysql&amp;gt; grant all on motiro_development.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; grant all on motiro_test.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; grant all on motiro_production.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; exit
Bye&lt;/pre&gt;&lt;/p&gt; &lt;h2&gt;&lt;a name='Point_to_MySQL'&gt;&lt;/a&gt; Point to MySQL &lt;/h2&gt; &lt;p&gt;
The file &lt;code&gt;config/database.yml&lt;/code&gt; is the one that points to the
database backend that Motiro should user. The default setup right now is
to use SQLite 3. In order to use you newly-created MySQL databases,
change the file contents for what you see below.&lt;/p&gt; &lt;p&gt;&lt;pre&gt;
development:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_development&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password:&amp;lt;/code&amp;gt;

test:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_test&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password:&amp;lt;/code&amp;gt;

production:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_production&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password: &amp;lt;/code&amp;gt;&lt;/pre&gt;&lt;/p&gt; &lt;h2&gt;&lt;a name='Preparing_the_schema'&gt;&lt;/a&gt; Preparing the schema &lt;/h2&gt; &lt;p&gt;
Last step for setting your databases is setting up their schemas correctly.
Fortunately, Motiro comes prepackaged with migration scripts for this
purpose. You will need to ask rake to run them.&lt;/p&gt; &lt;p&gt;&lt;pre&gt;% rake migrate&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;This last step is exactly the same thing that should be done for the default
set up. From now on you can refer to the &lt;a href="http://www.motiro.org/wiki/show/Installation"&gt;main instructions&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Mon, 25 Feb 2008 06:19:42 -0500</pubDate><dc:creator>thiagoarrais</dc:creator><guid>http://www.motiro.org/wiki/show/UsingMySQLAsDataBackend?revision=3</guid></item><item><title>Using MySQL as Data Backend</title><description>&lt;p&gt;Before starting, make sure that the MySQL database server is correctly
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/installing.html"&gt;installed&lt;/a&gt; and
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/post-installation.html"&gt;running&lt;/a&gt;. The
process described here was tested for version 4.1, but is likely to work on
other versions too.&lt;/p&gt; &lt;h2&gt;&lt;a name='TCP_Connection'&gt;&lt;/a&gt; TCP Connection &lt;/h2&gt; &lt;p&gt;
Motiro tries to connect to the MySQL server using a TCP socket. You will need
to make sure the server is up and listening for connections on port 3306
(MySQL default port). If you're not sure, try issuing the command&lt;/p&gt; &lt;p&gt;&lt;pre&gt;% telnet localhost 3306&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;The output should look something like&lt;/p&gt; &lt;p&gt;&lt;pre&gt;
7
&amp;lt;code&amp;gt; 4.1.18-nt&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;       xH?@cU]S,&#65533;!?h3d{bUf~jv5A&amp;lt;/code&amp;gt;&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;You may need to set up your MySQL server to accept TCP connections, if you
are sure the server is running and it doesn't respond to the above command.
You may also set up your MySQL server to answer only to connections
originated from the localhost, if you feel opening the port is a security
issue. For more information, please see the
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/index.html"&gt;MySQL user guide&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;&lt;a name='Database_creation'&gt;&lt;/a&gt; Database creation &lt;/h2&gt; &lt;p&gt;
Motiro uses the empty-passworded username 'motiro' to authenticate to the
MySQL server. It may need to access three differente databases, depending on
the execution context. The database names are&lt;/p&gt; &lt;ul&gt;&lt;li&gt; motiro_development: for development and initial test purposes&lt;/li&gt;&lt;li&gt; motiro_test: for automatic testing purposes&lt;/li&gt;&lt;li&gt; motiro_production: for real-life usage&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;
You will need to make sure those databases are present and fully-acessible
to the user motiro. The following script will do the trick. It is a
command-line script using the mysql client, but you may use any tool you'd
prefer (maybe a GUI or web-based one). Just make sure to create the
databases with the exact names and to grant all privileges to the motiro
user in them.&lt;/p&gt; &lt;p&gt;To use the mysql client just fire it as the root user and say (lines
starting with '%' are commands to my shell and with 'mysql&amp;gt;' are to the
MySQL database, others are the system responses to them):&lt;/p&gt; &lt;p&gt;&lt;pre&gt;
% mysql -u root -p
Enter password: ***********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 4.1.18-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&amp;gt; create database motiro_development;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; create database motiro_test;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; create database motiro_production;
Query OK, 1 row affected (0.02 sec)

mysql&amp;gt; grant all on motiro_development.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; grant all on motiro_test.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; grant all on motiro_production.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; exit
Bye&lt;/pre&gt;&lt;/p&gt; &lt;h2&gt;&lt;a name='Point_to_MySQL'&gt;&lt;/a&gt; Point to MySQL &lt;/h2&gt; &lt;p&gt;
The file &lt;code&gt;config/database.yml&lt;/code&gt; is the one that points to the
database backend that Motiro should user. The default setup right now is
to use SQLite 3. In order to use you newly-created MySQL databases,
change the file contents for what you see below.&lt;/p&gt; &lt;p&gt;&lt;pre&gt;
development:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_development&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password:&amp;lt;/code&amp;gt;

test:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_test&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password:&amp;lt;/code&amp;gt;

production:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_production&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password: &amp;lt;/code&amp;gt;&lt;/pre&gt;&lt;/p&gt; &lt;h2&gt;&lt;a name='Preparing_the_schema'&gt;&lt;/a&gt; Preparing the schema &lt;/h2&gt; &lt;p&gt;
Last step for setting your databases is setting up their schemas correctly.
Fortunately, Motiro comes prepackaged with migration scripts for this
purpose. You will need to ask rake to run them.&lt;/p&gt; &lt;p&gt;&lt;pre&gt;% rake migrate&lt;/pre&gt;&lt;/p&gt; &lt;p&gt;This last step is exactly the same thing that should be done for the default
set up. From now on you can refer to the &lt;a href="http://www.motiro.org/wiki/show/Installation"&gt;main instructions&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 14 Feb 2007 09:46:53 -0500</pubDate><dc:creator>thiagoarrais</dc:creator><guid>http://www.motiro.org/wiki/show/UsingMySQLAsDataBackend?revision=2</guid></item><item><title>Using MySQL as Data Backend</title><description>&lt;p&gt;Before starting, make sure that the MySQL database server is correctly
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/installing.html"&gt;installed&lt;/a&gt; and
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/post-installation.html"&gt;running&lt;/a&gt;. The
process described here was tested for version 4.1, but is likely to work on
other versions too.&lt;/p&gt;&lt;h2&gt;&lt;a name='TCP_Connection'&gt;&lt;/a&gt; TCP Connection &lt;/h2&gt;
&lt;p&gt;
Motiro tries to connect to the MySQL server using a TCP socket. You will need
to make sure the server is up and listening for connections on port 3306
(MySQL default port). If you're not sure, try issuing the command&lt;/p&gt;&lt;p&gt;&lt;pre&gt;% telnet localhost 3306&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;The output should look something like&lt;/p&gt;&lt;p&gt;&lt;pre&gt;
7
&amp;lt;code&amp;gt; 4.1.18-nt&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;       xH?@cU]S,&#65533;!?h3d{bUf~jv5A&amp;lt;/code&amp;gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;You may need to set up your MySQL server to accept TCP connections, if you
are sure the server is running and it doesn't respond to the above command.
You may also set up your MySQL server to answer only to connections
originated from the localhost, if you feel opening the port is a security
issue. For more information, please see the
&lt;a href="http://www.mysql.org/doc/refman/4.1/en/index.html"&gt;MySQL user guide&lt;/a&gt;.&lt;/p&gt;&lt;h2&gt;&lt;a name='Database_creation'&gt;&lt;/a&gt; Database creation &lt;/h2&gt;
&lt;p&gt;
Motiro uses the empty-passworded username 'motiro' to authenticate to the
MySQL server. It may need to access three differente databases, depending on
the execution context. The database names are&lt;/p&gt;&lt;ul&gt;&lt;li&gt; motiro_development: for development and initial test purposes&lt;/li&gt;&lt;li&gt; motiro_test: for automatic testing purposes&lt;/li&gt;&lt;li&gt; motiro_production: for real-life usage&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;
You will need to make sure those databases are present and fully-acessible
to the user motiro. The following script will do the trick. It is a
command-line script using the mysql client, but you may use any tool you'd
prefer (maybe a GUI or web-based one). Just make sure to create the
databases with the exact names and to grant all privileges to the motiro
user in them.&lt;/p&gt;&lt;p&gt;To use the mysql client just fire it as the root user and say (lines
starting with '%' are commands to my shell and with 'mysql&amp;gt;' are to the
MySQL database, others are the system responses to them):&lt;/p&gt;&lt;p&gt;&lt;pre&gt;
% mysql -u root -p
Enter password: ***********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 4.1.18-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&amp;gt; create database motiro_development;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; create database motiro_test;
Query OK, 1 row affected (0.00 sec)

mysql&amp;gt; create database motiro_production;
Query OK, 1 row affected (0.02 sec)

mysql&amp;gt; grant all on motiro_development.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; grant all on motiro_test.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; grant all on motiro_production.* to motiro;
Query OK, 0 rows affected (0.00 sec)

mysql&amp;gt; exit
Bye&lt;/pre&gt;&lt;/p&gt;&lt;h2&gt;&lt;a name='Point_to_MySQL'&gt;&lt;/a&gt; Point to MySQL &lt;/h2&gt;
&lt;p&gt;
The file &lt;code&gt;config/database.yml&lt;/code&gt; is the one that points to the
database backend that Motiro should user. The default setup right now is
to use SQLite 3. In order to use you newly-created MySQL databases,
change the file contents for what you see below.&lt;/p&gt;&lt;p&gt;&lt;pre&gt;
development:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_development&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password:&amp;lt;/code&amp;gt;

test:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_test&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password:&amp;lt;/code&amp;gt;

production:
&amp;lt;code&amp;gt;  adapter: mysql&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  database: motiro_production&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  host: 127.0.0.1&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  port: 3306&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  username: motiro&amp;lt;/code&amp;gt;
&amp;lt;code&amp;gt;  password: &amp;lt;/code&amp;gt;&lt;/pre&gt;&lt;/p&gt;&lt;h2&gt;&lt;a name='Preparing_the_schema'&gt;&lt;/a&gt; Preparing the schema &lt;/h2&gt;
&lt;p&gt;
Last step for setting your databases is setting up their schemas correctly.
Fortunately, Motiro comes prepackaged with migration scripts for this
purpose. You will need to ask rake to run them.&lt;/p&gt;&lt;p&gt;&lt;pre&gt;% rake migrate&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;This last step is exactly the same thing that should be done for the default
set up. From now on you can refer to the &lt;a href="http://www.motiro.org/wiki/show/Installation"&gt;main instructions&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 01 Feb 2006 00:00:00 -0500</pubDate><dc:creator>thiagoarrais</dc:creator><guid>http://www.motiro.org/wiki/show/UsingMySQLAsDataBackend?revision=1</guid></item>  </channel>
</rss>
