Catalyst-Manual

 view release on metacpan or  search on metacpan

lib/Catalyst/Manual/Tutorial/10_Appendices.pod  view on Meta::CPAN


Make sure the data loaded correctly:

    $ psql -U catappuser -W catappdb
    Password for user catappuser: <catalyst>
    Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

    Type:  \copyright for distribution terms
           \h for help with SQL commands
           \? for help with psql commands
           \g or terminate with semicolon to execute query
           \q to quit

    catappdb=> \dt
                 List of relations
     Schema |     Name     | Type  |   Owner
    --------+--------------+-------+------------
     public | authors      | table | catappuser
     public | book_authors | table | catappuser
     public | books        | table | catappuser
    (3 rows)

lib/Catalyst/Manual/Tutorial/10_Appendices.pod  view on Meta::CPAN


    apt-get install mysql-client mysql-server
    /etc/init.d/mysql start

B<NOTE:> The tutorial is based on Foreign Keys in database which is supported by InnoDB.
Only MySQL 5.0 and above supports InnoDB storage Engine so you need to have InnoDB support
in you MySQL. You can simply figure out that your install supports it or not:

    # mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input
    statement.

    mysql> SHOW VARIABLES LIKE 'have_innodb';
    +---------------+-------+
    | Variable_name | Value |
    +---------------+-------+
    | have_innodb   | YES   |
    +---------------+-------+

lib/Catalyst/Manual/Tutorial/10_Appendices.pod  view on Meta::CPAN


If the Value is "YES" you can use your setup (Debian based mysql supports it by default).
Else, you need to configure your my.cnf or start your MySQL daemon without --skip-innodb option.

=item *

Create the database and set the permissions:

    # mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> CREATE DATABASE `myapp`;
    Query OK, 1 row affected (0.01 sec)

    mysql> GRANT ALL PRIVILEGES ON myapp.* TO 'tutorial'@'localhost' IDENTIFIED BY 'yourpassword';
    Query OK, 0 rows affected (0.00 sec)

    mysql> FLUSH PRIVILEGES;

lib/Catalyst/Manual/Tutorial/10_Appendices.pod  view on Meta::CPAN

    mysql -u tutorial -p myapp < myapp01_mysql.sql

=item *

Make sure the data loaded correctly:

    $ mysql -u tutorial -p myapp
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Welcome to the MySQL monitor.  Commands end with ; or \g.

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

    mysql> show tables;
    +-----------------+
    | Tables_in_myapp |
    +-----------------+
    | authors         |
    | book_authors    |
    | books           |



( run in 0.227 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )