LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mysql access control question (https://www.linuxquestions.org/questions/linux-software-2/mysql-access-control-question-90256/)

antken 09-07-2003 03:32 PM

mysql access control question
 
hello,

like most linux people i have a mysql server with a few ( 50 or so ) databases in, recently i have started to host a database for a friend using a windows box. he has the windows version of mysql's control centre, which at the moment due to access lists and stuff is showing all 50+ databases.

as you may have been able to work out, this is both a) a security issue and B) a pain in the ass when he needs to find his database in a whole long list. the other databases that are listed he does not have access to however he can still see them.


my question is this:
is there a way to hide these databases from users that dont have access to them? if so how can i achieve this, is there a howto?

ruddy 09-08-2003 08:54 AM

re: mysql access
 
Hi,
There are a lot of documentions of mysql server, I understand that you can set rights for each user wich database can see, it's base authentification in mysql. You have to play with user and db tables into mysql database name.
Ciao,
Ruddy

antken 09-08-2003 05:15 PM

thanks for that,

at the risk of sounding stupid, could you give any hints?

i am guessing the global select settings :confused:

Hangdog42 09-08-2003 05:56 PM

Most access issues in MySQL are handled through GRANT and REVOKE statements. The documentation for how they are handled is here . However, I'm not sure that you can hide the existence of a particular database from a user. You can block them from using any (or all) databases, but if you grant SHOW DATABASES privileges, they can see that there are other databaes there.

However, don't take my word for it. My SQL skills are still in the newbie stage :D .


The other place to check might be DevShed . They have a MySQL forum that I've found somewhat useful.

ruddy 09-09-2003 04:51 AM

r:mysql
 
Hi,
Some basic coments :)
You need to add or set all your users (and passwd) on table "user" databases mysql with no rights (for each field set "N"). After that you must add your users on table "db" database mysql and there must set rigth that you need per each user and database:

see the samples here:

1). add or modify user in table user
use mysql

insert into user values ("your_host"," your_user",password("your password"), "N",.......);
or
update user set your_fields="N"....... where user="your user"
2).
add your users on table db.
insert into db value ("yout_host","your_user","your_database",....your rigths)

Sorry I'm not checked if the sintax is Ok,

Otherwise you use mysqlfront or webclient like "phpmyadmin" to do more easy that.

I hope that is enough :)
good job,
ruddy


All times are GMT -5. The time now is 04:03 PM.