Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.

Grant with load initial data not work #53

Open
emimarz opened this issue Dec 24, 2014 · 2 comments
Open

Grant with load initial data not work #53

emimarz opened this issue Dec 24, 2014 · 2 comments

Comments

@emimarz
Copy link

emimarz commented Dec 24, 2014

when vagrant load the first time I try to create a new user and import a mysql dump then I excecute this on default.pp
If I change the path of the file vagrant give me an error but I am in a position where no error are showed but neither the script are runing

here are my source code

thanks in advance

class { "mysql":
    root_password => '****', # my root password
}

mysql::grant { 'db1':
    mysql_privileges => 'ALL',
    mysql_password => 'admin',
    mysql_db => 'mydatabase', # my database
    mysql_user => 'admin', # a new user
    mysql_host => 'localhost',
    mysql_db_init_query_file => '/vagrant/files/mysql/schema.sql',
    mysql_create_db => true
}
@lermit
Copy link
Contributor

lermit commented Dec 29, 2014

Hi @emimarz,

I've just give it a try and all is ok for me.

Please can you verify that :
1/ The files/mysql/scehma.sql file is present in you vagrant instance root directory
2/ Inside the vagrant box. The file /vagrant/files/mysql/schema.sql is present too.
3/ The result of the following commande (inside vagrant box)
puppet apply --modulepath <path_to_puppet_modules_dir> <path_to_manifests_file>

Regards

@sloba88
Copy link

sloba88 commented Nov 19, 2015

Hi, my error could be similar:

I do this

class { "mysql":
        root_password => 'root',
    }

exec { 'set access':
        command => '/usr/bin/mysql -u root -proot -e "GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'%\' IDENTIFIED BY \'root\' WITH GRANT OPTION;"',
        require => Package["mysql"],
    }

And I get error:

Access denied for user 'root'@'localhost' (using password: YES)

I tried doing mysql restart between steps, what am I doing wrong?

Is there a command to grant all for root user using this module?

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants