Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
Created August 31, 2017 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CMCDragonkai/2fd83f106d0dfcae17d9653935602486 to your computer and use it in GitHub Desktop.
Save CMCDragonkai/2fd83f106d0dfcae17d9653935602486 to your computer and use it in GitHub Desktop.
Getting CURRENT_USER's privileges in MySQL #mysql #sql
SELECT * FROM mysql.user
WHERE
`User` = SUBSTRING_INDEX(CURRENT_USER(), '@', 1) AND
`Host` = SUBSTRING_INDEX(CURRENT_USER(), '@', -1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment