# User Administration for MySQL

It is recommended that each user be assigned a personal database account with only the required privileges. For more information on User Access Control and Account Management, please refer to the MySQL Reference Manual.

Note, this topic only provides instructions for performing the setup on the same computer as MySQL since remote administrative access is disabled by default. All instructions assume that the MySQL Server version is 8.4 and the root account is being used for MySQL administration.

Perform the following steps for any user that will need access to the pdfkeeper database. Substitute the user name, host name, and password for user_name, host_name, password.

1. Open a Command Prompt.

2. Execute "C:\Program Files\MySQL\MySQL Server 8.4\bin\mysql.exe" -u root -p

3. Enter the password w hen prompted.

4. For a new user, enter the following statement: create user 'user_name'@'host_name' identified by 'password'; For more information, see the MySQL Reference Manual.

5. Enter use pdfkeeper;

6. For a new account, enter the following statement to grant the user select/query access: grant select on docs to 'user_name'@'host_name';

7. To give the user the ability to upload documents, enter the following statement: grant insert on docs to 'user_name'@'host_name';

8. To give the user the ability to update documents, enter the following statement: grant update on docs to 'user_name'@'host_name';

9. To give the user the ability to delete documents, enter the following statement: grant delete on docs to 'user_name'@'host_name';

10. To prevent the user from uploading documents, enter the following statement: revoke insert on docs from 'user_name'@'host_name';

11. To prevent the user from updating documents, enter the following statement: revoke update on docs from 'user_name'@'host_name';

12. To prevent the user from deleting documents, enter the following statement: revoke delete on docs from 'user_name'@'host_name';