coza73 Posted September 8, 2006 Share Posted September 8, 2006 Is it possible to setup a mysql user to be able to create new databases but only be able to access/edit/see their own databases, and none of the existing databases or ones created by other users?i.e multible uses on one server creating, editing and removing their own databases with no access to any other databases on the server. And root to have global access to all databases created.Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/20089-user-priviledges-question/ Share on other sites More sharing options...
shoz Posted September 8, 2006 Share Posted September 8, 2006 The following GRANT should allow the users to create databases starting with "username_" and unless there's an error already in the permissions, users shouldn't be able to see databases they haven't been given explicit access to.[code]GRANT ALL ON `username\_%`.* TO username@localhost;GRANT ALL ON `username\_%`.* TO [email protected];[/code]Users by default have access to Db 'test' btw. Quote Link to comment https://forums.phpfreaks.com/topic/20089-user-priviledges-question/#findComment-88186 Share on other sites More sharing options...
coza73 Posted September 11, 2006 Author Share Posted September 11, 2006 Worked great, thank you. ;D Quote Link to comment https://forums.phpfreaks.com/topic/20089-user-priviledges-question/#findComment-89562 Share on other sites More sharing options...
shoz Posted September 11, 2006 Share Posted September 11, 2006 I should also mention that if you're adding new users you'll want to also add [code]IDENTIFIED BY 'password here'[/code]to the end of the GRANT statement or you'll create users with blank passwords.[code]GRANT ALL ON ... IDENTIFIED BY 'password'[/code] Quote Link to comment https://forums.phpfreaks.com/topic/20089-user-priviledges-question/#findComment-89577 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.