Connecting Tech Pros Worldwide Forums | Help | Site Map

Check if the user can create temporary?

Mr aldo's Avatar
Newbie
 
Join Date: Jul 2007
Posts: 15
#1: Oct 10 '08
Hi...

I am currently working on a search function, and I need to check and see if the current MySQL username has permission to create a temporary table, I have searched MySQL's site to no avail, any help is appreciated.

Thanks!

Needs Regular Fix
 
Join Date: Mar 2008
Posts: 311
#2: Oct 10 '08

re: Check if the user can create temporary?


You can use the "show grants for XXX" where XXX is your user.

I am not sure what permissions you need to have as user to be able to carry out this command, though.

If the user has permission to create temporary tables, then it will appear in the outcome of carrying out this query.

By the way, you didn't carry out your search of the Mysql site very well. I found the above information there.

I don't like the Mysql site's search for finding things. I came to the above information using a Google search, using the string "mysql create temporary tables" and then after I saw that there was a reference to the "show grants" command, I Googled "mysql show grants syntax". In both cases, the top Google search results were pointing to the proper pages on Mysql's site.
nomad's Avatar
Expert
 
Join Date: Mar 2007
Location: CA.
Posts: 570
#3: Oct 15 '08

re: Check if the user can create temporary?


you could use a PHP code to do this.

nomad
Reply