Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql_grant is not working for grants on a PROCEDURE #378

Closed
tekenny opened this issue Nov 18, 2013 · 3 comments
Closed

mysql_grant is not working for grants on a PROCEDURE #378

tekenny opened this issue Nov 18, 2013 · 3 comments

Comments

@tekenny
Copy link
Contributor

tekenny commented Nov 18, 2013

I tried to reverse engineer the proper syntax for to setup a grant on a procedure. My DBA set it up and I then performed "puppet resource mysql_grant" which provided a resource definition similar to below

mysql_grant { "repgen@localhost/PROCEDURE ${dbName}.my_proc":
  ensure     => present,
  options    => ['GRANT'],  
  privileges => ['EXECUTE'],
  table      => "PROCEDURE ${dbName}.my_proc",
  user       => 'repgen@localhost',
  require    => Service['mysqld'],
}

However applying it causes the following error

Error: Execution of '/usr/bin/mysql -e GRANT EXECUTE ON `PROCEDURE rdb`.my_rpoc TO 'repgen'@'localhost'' returned 1: ERROR 1144 (42000) at line 1: Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used
@tekenny
Copy link
Contributor Author

tekenny commented Nov 18, 2013

The problem seems to be back ticks around PROCEDURE rdb the following command line seemed to work properly so it seems the provider isn't formatting the command properly thinking PROCEDURE is part of the table name.

/usr/bin/mysql -e "GRANT EXECUTE ON PROCEDURE rdb.my_proc TO 'repgen'@'localhost'"

@dgolja
Copy link
Contributor

dgolja commented Jan 11, 2014

Committed the solution ...

Cheers

dgolja added a commit to dgolja/puppetlabs-mysql that referenced this issue Jan 20, 2014
@Aaron-Rob
Copy link

Hello! We are doing some house keeping and noticed that this issue has been open for a long time. We're going to close it but please do raise another issue if the issue still persists. 😄

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

No branches or pull requests

3 participants