Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-17-2006, 06:17 PM
|
#1
|
Senior Member
Registered: Jan 2004
Posts: 1,420
Rep: 
|
Error with MySQL Grant Command for other users
Have MySQL up and runnin on my Slackware laptop, just using it to play around and have fun.
I have two users under MySQL, root and a regular user. I create a database as root and grant rights to the regular user to the database.
As root...
Code:
grant * on foo to regularuser@localhost;
When I login to MySQL as the regular user and say try to create or drop a table, I get the command denied output.
What am I doing wrong, or can only root drop/create tables?
thanks
|
|
|
02-17-2006, 06:25 PM
|
#2
|
Member
Registered: Apr 2005
Distribution: Fedora Core (latest version)
Posts: 156
Rep:
|
Did you flush privileges;
Code:
mysql>grant all on * to user@"localhost" identified by 'password' with grant option;
mysql>flush privileges;
mysql>quit;
Last edited by accessrichard; 02-17-2006 at 06:26 PM.
|
|
|
02-17-2006, 07:28 PM
|
#3
|
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
|
It should be:
Code:
grant all on foo.* to regularuser@localhost;
|
|
|
02-17-2006, 07:43 PM
|
#4
|
Senior Member
Registered: Jan 2004
Posts: 1,420
Original Poster
Rep: 
|
Quote:
Originally Posted by accessrichard
Did you flush privileges;
Code:
mysql>grant all on * to user@"localhost" identified by 'password' with grant option;
|
I don't believe these worked.
Quote:
Originally Posted by accessrichard
Code:
mysql>flush privileges;
mysql>quit;
|
Interesting, I didin't know about the flush command, is this a standard SQL command or something at a different level?
|
|
|
02-17-2006, 07:45 PM
|
#5
|
Senior Member
Registered: Jan 2004
Posts: 1,420
Original Poster
Rep: 
|
Quote:
Originally Posted by gbonvehi
It should be:
Code:
grant all on foo.* to regularuser@localhost;
|
This gave the regular user the ability to create/drop or DDL commands.
But the regular user still can't create a database. Can only root do this?
thanks
|
|
|
02-17-2006, 07:54 PM
|
#6
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
Have you reloaded MySQL?
|
|
|
02-17-2006, 11:25 PM
|
#7
|
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145
Rep:
|
I've never tried, but I guess *.* would do the trick.
|
|
|
02-18-2006, 04:32 PM
|
#8
|
Member
Registered: Apr 2005
Distribution: Fedora Core (latest version)
Posts: 156
Rep:
|
From mysql.com
Quote:
The FLUSH statement clears or reloads various internal caches used by MySQL
|
The FLUSH PRIVILEGES command basically reloads accounts and passwords
When I create a user for myself I believe I use
GRANT ALL PRIVILEGES ON etc.
and I am able to create and delete databases.
MySQL howto add new users
http://dev.mysql.com/doc/refman/5.0/...ing-users.html
Thanks gbonvehi, I never actualy used the * I always specify a db name, it is good to know that that wont work for my future references.
Last edited by accessrichard; 02-18-2006 at 04:56 PM.
|
|
|
02-19-2006, 02:57 PM
|
#9
|
Senior Member
Registered: Jan 2004
Posts: 1,420
Original Poster
Rep: 
|
Quote:
Originally Posted by mdarby
Have you reloaded MySQL?
|
What do you mean by 'reload?'
Stopping and starting the service?
thanks
|
|
|
02-19-2006, 03:37 PM
|
#10
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
yep, restart the actual program.
|
|
|
All times are GMT -5. The time now is 06:55 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|