GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  HAILO::STORAGE::MYSQL (3)

.ds Aq ’

NAME

Hailo::Storage::MySQL - A storage backend for Hailo using DBD::mysql

CONTENTS

SYNOPSIS

As a module:



    my $hailo = Hailo->new(
        storage_class => mysql,
        storage_args  => {
            database  => hailo,
            host      => localhost,
            port      => 3306,
            username  => hailo,
            password  => hailo
        },
    );
    $hailo->train("hailo.trn");



From the command line:



    hailo --train hailo.trn \
        --storage      mysql \
        --storage-args database=hailo \
        --storage-args host=localhost \
        --storage-args port=3306 \
        --storage-args username=hailo \
        --storage-args password=hailo



Almost all of these options can be omitted, see DBD::mysql’s documentation for the default values.

See Hailo’s documentation for other non-MySQL specific options.

DESCRIPTION

This backend maintains information in a MySQL database.

ATTRIBUTES

CWstorage_args

This is a hash reference which can have the following keys:

<B>’database’B>, the name of the database to use (required).

<B>’host’B>, the host to connect to (required).

<B>’port’B>, the port to connect to (required).

<B>’username’B>, the username to use.

<B>’password’B>, the password to use.

CAVEATS

MySQL sucks.

MySQL setup

Before creating a database for Hailo you need to ensure that the <B>collation_connectionB>, <B>collation_databaseB> and <B>collation_serverB> for the new database will be equivalent, you can do this by adding this to your [mysqld] section in my.cnf:



    skip-character-set-client-handshake
    collation_server=utf8_unicode_ci
    character_set_server=utf8



Now when you create the database you should get something like this:



    mysql> show variables like coll%;
    +----------------------+-----------------+
    | Variable_name        | Value           |
    +----------------------+-----------------+
    | collation_connection | utf8_unicode_ci |
    | collation_database   | utf8_unicode_ci |
    | collation_server     | utf8_unicode_ci |
    +----------------------+-----------------+



If you instead get this:



    +----------------------+-------------------+
    | Variable_name        | Value             |
    +----------------------+-------------------+
    | collation_connection | utf8_unicode_ci   |
    | collation_database   | latin1_swedish_ci |
    | collation_server     | utf8_unicode_ci   |
    +----------------------+-------------------+



Then Hailo will eventually die when you train it on an error similar to this:



    DBD::mysql::st execute failed: Illegal mix of collations (latin1_swedish_ci,IMPLICIT)
    and (utf8_unicode_ci,COERCIBLE) for operation = at [...]



After taking care of that create a MySQL database for Hailo using something like these commands:



    mysql -u root -p
    CREATE DATABASE hailo;
    GRANT USAGE ON *.* TO hailo@localhost IDENTIFIED BY hailo;
    GRANT ALL ON hailo.* TO hailo@localhost IDENTIFIED BY hailo;
    FLUSH PRIVILEGES;



AUTHOR

AEvar Arnfjoerd` Bjarmason <avar@cpan.org>

LICENSE AND COPYRIGHT

Copyright 2010 AEvar Arnfjoerd` Bjarmason.

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 HAILO::STORAGE::MYSQL (3) 2011-09-18

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.