Re: grant user privileges
On Tue, Apr 15, 2008 at 9:03 AM, Hiep Nguyen [EMAIL PROTECTED] wrote: hi all, i have an existing database (internal) with a user named 'admin', everything works fine as far as privileges concern. i just created a new database (test) and want to grant admin's privileges on test as same as internal. how do i do this??? i tried (as root): grant all on test.* to 'admin'@'localhost'; grant all on test.* to 'admin'@'10.0.0.%'; GRANT ALL PRIVILEGES ON test.* TO 'admin'@'localhost' IDENTIFIED BY 'passwordString'; GRANT ALL PRIVILEGES ON test.* TO 'admin'@'%' IDENTIFIED BY 'passwordString'; FLUSH PRIVILEGES; The first query grants all privileges to admin when accessing the host locally. The second query allows you to connect from ANY host. The third query flushes the old privileges data and ensures that the updated mysql.users information is used. Be sure to replace passwordString with your password. If you only want access to be on the Class C private network subnet for 10.0.0.x (RFC 1918) as well as localhost, then adjust query #2 to: GRANT ALL PRIVILEGES ON test.* TO 'admin'@'10.0.0.%' IDENTIFIED BY 'passwordString'; and then FLUSH PRIVILEGES; again. -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: grant user privileges
On Wed, 16 Apr 2008, Daniel Brown wrote: On Tue, Apr 15, 2008 at 9:03 AM, Hiep Nguyen [EMAIL PROTECTED] wrote: hi all, i have an existing database (internal) with a user named 'admin', everything works fine as far as privileges concern. i just created a new database (test) and want to grant admin's privileges on test as same as internal. how do i do this??? i tried (as root): grant all on test.* to 'admin'@'localhost'; grant all on test.* to 'admin'@'10.0.0.%'; GRANT ALL PRIVILEGES ON test.* TO 'admin'@'localhost' IDENTIFIED BY 'passwordString'; GRANT ALL PRIVILEGES ON test.* TO 'admin'@'%' IDENTIFIED BY 'passwordString'; FLUSH PRIVILEGES; The first query grants all privileges to admin when accessing the host locally. The second query allows you to connect from ANY host. The third query flushes the old privileges data and ensures that the updated mysql.users information is used. Be sure to replace passwordString with your password. If you only want access to be on the Class C private network subnet for 10.0.0.x (RFC 1918) as well as localhost, then adjust query #2 to: GRANT ALL PRIVILEGES ON test.* TO 'admin'@'10.0.0.%' IDENTIFIED BY 'passwordString'; and then FLUSH PRIVILEGES; again. i understand all of these, but let me re-state my question: assume user admin has a few privileges (which i don't know, but can find out) on internal database. let say that i create a new database and want to grant admin's privileges on test so that admin's privileges on internal = admin's privileges on test instead of find out what are privileges of admin on internal (select, update, insert,..) and then grant select,update, insert,... on on test.* to 'admin'@'localhost' identified by 'password'; is there any command that can set so that admin's privileges on internal = admin's privileges on test??? what i'm trying to avoid is manually adjust admin's privileges on test if admin's privileges on internal changed. if it's not still clear, then stupid menever mind. t. hiep -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: grant user privileges
On Wed, Apr 16, 2008 at 1:18 PM, Hiep Nguyen [EMAIL PROTECTED] wrote: is there any command that can set so that admin's privileges on internal = admin's privileges on test??? what i'm trying to avoid is manually adjust admin's privileges on test if admin's privileges on internal changed. if it's not still clear, then stupid menever mind. If I'm understanding correctly, you want user 'admin' to be able to access multiple databases, using one password and one permission set. If that's the case, then yes, it can be done but as far as I know, only by selecting ALL databases. Such as: GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'passwordString'; FLUSH PRIVILEGES; Then, when updating privileges for 'admin', just include *.* instead of a particular database.table limit. Keep in mind, though, that 'admin' will then have access to EVERY database on the server. I'm not sure that there's a way to comma-delimit (or something of the type) a select few database.table configurations. A quick search of the web didn't show any different either. -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: grant user privileges
Sebastian Mendel schrieb: Hiep Nguyen schrieb: hi all, i have an existing database (internal) with a user named 'admin', everything works fine as far as privileges concern. i just created a new database (test) and want to grant admin's privileges on test as same as internal. how do i do this??? i tried (as root): grant all on test.* to 'admin'@'localhost'; grant all on test.* to 'admin'@'10.0.0.%'; but it seems not right. grant access to admin from 'foreign' hosts? 10.0.0.0.% is not the host admin connects from but _TO_! this must be the host of the MySQL server, the host that is specified when connecting _TO_ the database. sorry, bulls***, i was totally wrong, of course ... -- Sebastian -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
grant user privileges
hi all, i have an existing database (internal) with a user named 'admin', everything works fine as far as privileges concern. i just created a new database (test) and want to grant admin's privileges on test as same as internal. how do i do this??? i tried (as root): grant all on test.* to 'admin'@'localhost'; grant all on test.* to 'admin'@'10.0.0.%'; but it seems not right. thanks, -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: grant user privileges
Can you give the output of the command show grants for admin; Thank You, -srini Hiep Nguyen wrote: hi all, i have an existing database (internal) with a user named 'admin', everything works fine as far as privileges concern. i just created a new database (test) and want to grant admin's privileges on test as same as internal. how do i do this??? i tried (as root): grant all on test.* to 'admin'@'localhost'; grant all on test.* to 'admin'@'10.0.0.%'; but it seems not right. thanks, -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: grant user privileges
Hiep Nguyen schrieb: hi all, i have an existing database (internal) with a user named 'admin', everything works fine as far as privileges concern. i just created a new database (test) and want to grant admin's privileges on test as same as internal. how do i do this??? i tried (as root): grant all on test.* to 'admin'@'localhost'; grant all on test.* to 'admin'@'10.0.0.%'; but it seems not right. grant access to admin from 'foreign' hosts? 10.0.0.0.% is not the host admin connects from but _TO_! this must be the host of the MySQL server, the host that is specified when connecting _TO_ the database. -- Sebastian -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]