The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

SYNOPSIS

As a module:

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

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

storage_args

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

'database', the name of the database to use (required).

'host', the host to connect to (required).

'port', the port to connect to (required).

'username', the username to use.

'password', the password to use.

CAVEATS

MySQL sucks.

Setup notes

Here's how I create a MySQL database for Hailo:

    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

Ævar Arnfjörð Bjarmason <avar@cpan.org>

LICENSE AND COPYRIGHT

Copyright 2010 Ævar Arnfjörð Bjarmason.

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