Jump to content

Recommended Posts

Posted (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 by Krydos
removed db/tables
Posted

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.

Posted (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 by Krydos
removed db/tables
Posted (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 by Krydos
removed db/tables
Posted

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

Posted

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 help

Done.

 

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.

  • 11 months later...
Posted (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 by cmh
Posted (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 by Krydos
removed info
Posted

I apologize for all the mistakes. In the future this will not happen again.

 
  Everything works, thank you.
Guest
This topic is now closed to further replies.
×
×
  • Create New...