Skip to content

Commit

Permalink
added some administrating features to mysql module
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan committed Mar 11, 2012
1 parent 2dd6067 commit 2f007f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions Database/MySQL.pm
Expand Up @@ -32,6 +32,7 @@ task "setup", sub {
my $service = $service_name{get_operating_system()};

# install mysql package
update_package_db;
install package => $pkg;

# ensure that mysql is started
Expand Down
17 changes: 12 additions & 5 deletions Database/MySQL/Admin/User.pm
Expand Up @@ -36,8 +36,6 @@ task drop => sub {
my $param = shift;
die("You have to specify the user name.") unless $param->{name};
die("You have to specify the users host.") unless $param->{host};
die("You have to specify the users rights.") unless $param->{rights};
die("You have to specify the users schemas.") unless $param->{schema};

my $name = $param->{name};
my $host = $param->{host};
Expand All @@ -52,15 +50,24 @@ task drop => sub {

=pod
=head2 Managa a Schema
=head2 Managa MySQL User
This module allows you to manage your MySQL Schemas.
This module allows you to manage your MySQL Users.
=head2 USAGE
task "taskname", sub {
Database::MySQL::Admin::Schema::create({
Database::MySQL::Admin::User::create({
name => "foo",
host => "host",
password => "password",
rights => "SELECT,INSERT",
schema => "foo.*",
});
Database::MySQL::Admin::User::drop({
name => "foo",
host => "host",
});
};

0 comments on commit 2f007f8

Please sign in to comment.