Granting access rights to a user

Granting access rights to a user

am 18.11.2010 21:03:53 von Tim Johnson

using
mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu

I have root access to the mysql command line.

I need to grant access to user 'username' for all databases
except for the mysql database for both onsite (cgi script) and
remote access.

What is the syntax?

--
Tim
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Granting access rights to a user

am 18.11.2010 22:46:18 von Tim Johnson

* Tim Johnson [101118 11:05]:
> using
> mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu
>
> I have root access to the mysql command line.
>
> I need to grant access to user 'username' for all databases
> except for the mysql database for both onsite (cgi script) and
> remote access.
>
> What is the syntax?
here is what I did to solve this:
As root I issued from the mysql DB:
SHOW GRANTS FOR username@'%';
Then making note of the stored grant commands
issued
GRANT ALL PRIVILEGES ON `dbname`.* TO 'username'@'%' WITH GRANT
OPTION
for which tables I need access for 'username'.

--
Tim
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Granting access rights to a user

am 19.11.2010 00:54:07 von Tim Johnson

* Tim Johnson [101118 12:58]:
> * Tim Johnson [101118 11:05]:
> > using
> > mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu
> >
> > I have root access to the mysql command line.
> >
> > I need to grant access to user 'username' for all databases
> > except for the mysql database for both onsite (cgi script) and
> > remote access.
> >
> > What is the syntax?
> here is what I did to solve this:
> As root I issued from the mysql DB:
> SHOW GRANTS FOR username@'%';
> Then making note of the stored grant commands
> issued
> GRANT ALL PRIVILEGES ON `dbname`.* TO 'username'@'%' WITH GRANT
> OPTION
> for which tables I need access for 'username'.
michael dykman points out (OTL) that it is not a good idea to give
a user a grant option

The syntax for removing the grant option is:
REVOKE GRANT OPTION ON databasename.* FROM 'username'@'%';

at least that is what I deduce from docs and
`show grants for user;'
displays user privileges without the grant option.
:) I'm cleaning up after someone else.
cheers
--
Tim
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org