List:General Discussion« Previous MessageNext Message »
From:Douglas Brantz Date:November 1 2000 4:34pm
Subject:Re: MySQL User Administration
View as plain text  
I think the best way to do this is through the mysql mysql table and add the user to the
user table.
so ./mysql mysql -u username -p (return) password (return)
show tables (shows you a list of the tables host,user,db etc.)
then you can describe user and it displays the fields in user.

Important - add the user to the user table with no permissions at all.  You can add
permissions for the user when you add them to the db table for the specified database.

So, insert into user (Host, User, Password etc) values
("%","newuser",password=("password"),"etc");

then go to the db table and add permissions for that user there.

insert into db and follow the same format - you can describe the table first with describe
db to get the field names - should be the same as user except for password.

Then when your done with all that you can exit mysql and then ./mysqladmin reload -u
username -p (return) password (return) and the permissions should be updated.

I usually have the users authenticated  in the database connect script with their username
and password by asking for it in a username password field in the form.

I would like to ask others if there is a better way to add users to a database-  Am I
being old fashion by doing it as I describe above and am I doing this the wrong way. 
Please let me know.

Thanks

Douglas



Erich Kolb wrote:

> Can someone tell me how to add new users to MySQL?  I can seem to find anything in
> the documentation.  Also, does MySQL authenticate through the main MySQL table.users, or
> is it done through individual databases?  Any help would be greatly appreciated!

--

Douglas Brantz
Computer Consultant
Fine & Applied Arts
Appalachian State University
Boone, NC 28608

828-262-6312 FAX
828-262-6549 OFFICE
brantzdr@stripped


Thread
MySQL User AdministrationErich Kolb1 Nov
  • Re: MySQL User AdministrationJames Treworgy1 Nov
  • Re: MySQL User AdministrationLeonardo Magallon1 Nov
  • Re: MySQL User AdministrationDouglas Brantz1 Nov
    • Re: MySQL User AdministrationJames Treworgy1 Nov
    • RE: MySQL User AdministrationRobert Goff2 Nov
      • Need to put a quota on the database sizeGOLDBERG2 Nov
        • Re: Need to put a quota on the database sizeThimble Smith2 Nov
          • Re: Need to put a quota on the database sizeJames Treworgy2 Nov
  • Re: MySQL User AdministrationWalter Bertin1 Nov
    • Re: MySQL User AdministrationJames Treworgy1 Nov