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  -  TEST::MYSQLD (3)

.ds Aq ’

NAME

Test::mysqld - mysqld runner for tests

CONTENTS

SYNOPSIS



  use DBI;
  use Test::mysqld;
  use Test::More;
 
  my $mysqld = Test::mysqld->new(
    my_cnf => {
      skip-networking => , # no TCP socket
    }
  ) or plan skip_all => $Test::mysqld::errstr;
 
  plan tests => XXX;
 
  my $dbh = DBI->connect(
    $mysqld->dsn(dbname => test),
  );



DESCRIPTION

Test::mysqld automatically setups a mysqld instance in a temporary directory, and destroys it when the perl script exits.

FUNCTIONS

    new

Create and run a mysqld instance. The instance is terminated when the returned object is being DESTROYed. If required programs (mysql_install_db and mysqld) were not found, the function returns undef and sets appropriate message to $Test::mysqld::errstr.

    base_dir

Returns directory under which the mysqld instance is being created. The property can be set as a parameter of the new function, in which case the directory will not be removed at exit.

    copy_data_from

If specified, uses a copy of the specified directory as the data directory of MySQL. Mysql database (which is used to store admistrative information) is automatically created if necessary by invoking mysql_install_db.

    my_cnf

A hash containing the list of name=value pairs to be written into my.cnf. The property can be set as a parameter of the new function.

    mysql_install_db

    mysqld

Path to mysql_install_db script or mysqld program bundled to the mysqld distribution. If not set, the program is automatically search by looking up $PATH and other prefixed directories.

    dsn

Builds and returns dsn by using given parameters (if any). Default username is ’root’, and dbname is ’test’.

    pid

Returns process id of mysqld (or undef if not running).

    start

Starts mysqld.

    stop

Stops mysqld.

    setup

Setups the mysqld instance.

    read_log

Returns the contents of the mysqld log file.

COPYRIGHT

Copyright (C) 2009 Cybozu Labs, Inc. Written by Kazuho Oku.

LICENSE

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

See <http://www.perl.com/perl/misc/Artistic.html>

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


perl v5.20.3 TEST::MYSQLD (3) 2013-03-26

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