HelioHost Posted June 30, 2017 Posted June 30, 2017 (edited) Hello. I need help.i want to set permission for users: All users can=20 use only Select (done) user cmh_<removed> can work only with tables <removed>, <removed>, <removed>; user cmh_<removed> can work only with tables <removed>, <removed>, <removed>; user cmh_<removed> can work only with tables <removed>, <removed>, <removed>; Edited June 30, 2017 by Krydos removed db/tables
Luigi123 Posted June 30, 2017 Posted June 30, 2017 1. Go to tommy.heliohost.org:2082/cpsess8685809182/frontend/paper_lantern/sql/index.html . 2. Scroll down to "Add user to Database". 3. Select your MySQL Username, then select your Database Name and click "Add". 4. Check the appropriate permissions required, and click "Make Changes" and you're done.
cmh Posted June 30, 2017 Posted June 30, 2017 (edited) Why you talk about tommy? BTW, This is not what I need. I want to block access to all tables except those that are allowed ..For example, the user cmh_ip can work with 3 tables, and the rest are not accessible to him something like (but i can't run it in sql )GRANT SELECT ON yourdatabase.<removed> TO 'cmh_<removed>'@'%' Edited June 30, 2017 by Krydos removed db/tables
Krydos Posted June 30, 2017 Posted June 30, 2017 (edited) Why you talk about tommy?Because you didn't say what server you were on. mysql> show grants for cmh_<removed>@localhost; +---------------------------------------------------------------------------------------------------------------+ | Grants for cmh_<removed>@localhost | +---------------------------------------------------------------------------------------------------------------+ | GRANT SELECT ON `cmh_<removed>`.`<removed>` TO 'cmh_<removed>'@'localhost' | | GRANT SELECT ON `cmh_<removed>`.`<removed>` TO 'cmh_<removed>'@'localhost' | | GRANT SELECT ON `cmh_<removed>`.`<removed>` TO 'cmh_<removed>'@'localhost' | +---------------------------------------------------------------------------------------------------------------+ mysql> show grants for cmh_<removed>@localhost; +------------------------------------------------------------------------------------------------------------------+ | Grants for cmh_<removed>@localhost | +------------------------------------------------------------------------------------------------------------------+ | GRANT SELECT ON `cmh_<removed>`.`<removed>` TO 'cmh_<removed>'@'localhost' | | GRANT SELECT ON `cmh_<removed>`.`<removed>` TO 'cmh_<removed>'@'localhost' | | GRANT SELECT ON `cmh_<removed>`.`<removed>` TO 'cmh_<removed>'@'localhost' | +------------------------------------------------------------------------------------------------------------------+ mysql> show grants for cmh_<removed>@localhost; +-------------------------------------------------------------------------------------------------------------------+ | Grants for cmh_<removed>@localhost | +-------------------------------------------------------------------------------------------------------------------+ | GRANT SELECT ON `cmh_<removed>`.`<removed>` TO 'cmh_<removed>'@'localhost' | | GRANT SELECT ON `cmh_<removed>`.`<removed>` TO 'cmh_<removed>'@'localhost' | | GRANT SELECT ON `cmh_<removed>`.`<removed>` TO 'cmh_<removed>'@'localhost' | +-------------------------------------------------------------------------------------------------------------------+ Edited June 30, 2017 by Krydos removed db/tables
cmh Posted June 30, 2017 Posted June 30, 2017 Yes, it's exactly what i want but please change @'localhost' to @'%' And then hide or delete all details of logins, db/tables name from this topic. Ty again for your help
Krydos Posted June 30, 2017 Posted June 30, 2017 Yes, it's exactly what i want but please change 'localhost' to @'%'Done. And then hide or delete all details of logins, db/tables name from this topic. Ty again for your helpDone. For anyone who searches and finds this in the future it is possible to grant these really restrictive permissions, but an admin has to do it for you. Unfortunately cpanel doesn't allow permissions on specific tables. If you grant select through cpanel it is for all tables in the database.
cmh Posted June 7, 2018 Posted June 7, 2018 (edited) Hello. I need to add another table (stars_es) for user chm_stars. Server: Tommy. And then hide or delete all details of logins, db/tables name from this topic. Ty again for your help. Edited June 7, 2018 by cmh
Krydos Posted June 7, 2018 Posted June 7, 2018 (edited) First of all, your username is cmh not chm. Second, there is no user chm_stars, but I assume you mean cmh_<removed>. Mysql is case sensitive for this. You didn't specify the database so I had to search for it, but you only have one database so that was easy enough but it did waste some time. Next, there is no table named stars_es again because it's actually <removed>. Tables are case sensitive too. If you make requests like this in the future please provide full and accurate data. It makes it a lot less frustrating for me. I'll remove the names once you acknowledge that you have read it. Edited June 7, 2018 by Krydos removed info
cmh Posted June 7, 2018 Posted June 7, 2018 I apologize for all the mistakes. In the future this will not happen again. Everything works, thank you.
Recommended Posts