I think the best way to do this is through the mysql mysql table and add the user to the
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
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.
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!
Fine & Applied Arts
Appalachian State University
Boone, NC 28608