Issue on mysql charm user permission #4

Closed
prabucjs opened this Issue Jul 15, 2016 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

prabucjs commented Jul 15, 2016

Hi Marco,

My sample charm uses mysql-root interface for executing mysql queries in the remote machine. Using mysql-root interface I was able to create a database for my product but i am not able to give GRANT access to it. But there was a failure on the last "GRANT ALL" statement. Log link is for your perusal is http://pastebin.ubuntu.com/19522391/

I explored and found the actual cause of this issue. It is because of the user which was created by the mysql charm. If you modify the sql query which is used to create a mysql user at the mysql charm side as mentioned below

1, CREATE USER ''@'localhost' IDENTIFIED BY 'some_pass';
2, GRANT ALL PRIVILEGES ON . TO '< Mysql user name>'@'localhost' WITH GRANT OPTION;

Here the second query which I have mentioned above uses WITH GRANT OPTION will grants the permission. If Mysql charm give a user created for us using the above query, we can use this via mysql-root interface and it will not cause any error while running GRANT command.

Kindly check and adivise if i could get the user from mysql-root interface WITH GRANT OPTION;

Thanks

Contributor

mbruzek commented Aug 8, 2016

@prabucjs I suggest that you make the changes you would like to see in the code and propose that as a pull request to the relation code, so we can review this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment