puppet-mysql icon indicating copy to clipboard operation
puppet-mysql copied to clipboard

Grant with load initial data not work

Open emimarz opened this issue 10 years ago • 2 comments

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
}

emimarz avatar Dec 24 '14 12:12 emimarz

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

lermit avatar Dec 29 '14 19:12 lermit

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

sloba88 avatar Nov 19 '15 17:11 sloba88