Source for more detailed client documentation?
Closed this issue · 3 comments
Hello,
Working with the Thrift client has a few areas of confusion. For example:
-
How can I list all users? 'SELECT User FROM mysql.user;' doesn't work but I can't see an alternative method
-
exec_config
seems to fail (InvalidRequestException
) on the documentation'sinit.sql
queries, that I can execute readily inactordb_console
, so I'm confused why I would use this overexec_sql
, which also applies to any other convenience method where I can approximate them all simply passing sql, but I can't find documentation describing its limitations/intended use -- I assumed it was a simple alias foruse config
but that hasn't proved true. Every attempt to create a user viaexec_config
orexec_sql
has failed. -
I can't find the documentation for
list<string> flags
that are available on several query methods
Example:
Calling exec_sql
or exec_config
and passing in the following SQL, I'm getting a Reply of "Execute exception."
Each SQL statement is on a newline. I can run this line for line in console successfully. I am logged in as root user (also created via the console).
use config
CREATE USER 'myuser' IDENTIFIED BY 'mypass'
GRANT read,write ON * to 'myuser'
commit
"use config" tells console app that exec_config will be used.
Every SQL statement must have ; at the end. Console will add it if it is not present.
commit tells console to call exec_config with all statements in a single string since last commit call.
list flags are direct strings of flags we have documented in 4.2: "create" and "safe"
Thanks for taking the time to answer.
So is there no way to retrieve a list of all users?
I was reading the init.sql example too literally, missing the ; delimiting and incorporating console-only commands. I also assumed that each statement should be on a new line, even connected statements like CREATE USER ...
followed by GRANT ...
on a new line in init.sql.
Calling exec_config("CREATE USER 'myuser' IDENTIFIED BY 'mypass' GRANT read,write ON * to 'myuser';");
does the job. Thanks for your help!
Taking my users question to gitter, everything else is solved.