Now that we've set up our database and table it would be a good time to take a look at setting up users
and user privileges.
Earlier we discussed the route user.
We know that the route user is assigned all privileges and has complete control over database administration
what if we wanted to allow certain users to only be able to perform certain tasks.
Well we can do that by creating a new user and limiting the privileges of the user before we get started.
Make sure you're on the home screen by clicking the home button.
Now click on the user's button in the main menu
next click add user
under the heading logging information type in a new user name for the user
now specify which host name the user will connect from.
For example if you want the user to be able to connect from any IP address or hostname you can select
the any host option
if you wanted to limit the hostname to a specific computer on your local network you can select the
use text field option and type in the computer's IP or hostname
for the purpose of this exercise.
Use the any host option will delete this user after we're done because we'll be connecting to our database
as a root user now typing in a password for this user
for a more secure password.
You can click the Generate password button but remember to save the password in a secure file because
it's fairly long and hard to remember
before we move onto the next set of options here.
It's important to note that when it comes to user privileges there are three types of privilege categories.
This includes global privileges database specific privileges and table specific privileges if you assign
a user global privileges is seen here under this heading these privileges will be applicable to all
databases on my askew web server.
This is generally not a good practice.
It's much better to assign non route users database specific and to table specific privileges as the
name suggests database and table specific privileges apply only to a specific database or table we can
assign these privileges after we complete this section for now under the heading database for user leave.
Both boxes unchecked because we don't want to create a new database for this user nor do we want to
grant privileges on a wild card.
Name we also don't want to give this user any global privileges so we'll leave these check boxes empty
as well.
In case you do want to create global privileges at some point in the future we can do a brief overview
of the options.
The first section here under the heading data is to assign data privileges only.
This means the user can select Insert update delete or file data depending on which items we check off.
With data privileges the user cannot do things like delete the entire database or modify its structure
or indexes we can assign structure privileges in this section here if you want the user to be able to
create alter or drop the database among other things.
You can specify them by placing a checkmark in the appropriate checkboxes.
For example if you'd like the user to be able to drop a database put a checkmark in the drop checkbox
the administration section allows you to define whether the user can do things like create new users
or grant privileges
we can also set resource limits on the user.
So they are not too resource intensive on the system.
In this section here
as you can see there's many options for more information about each option.
You can find them in the HP my admin documentation available at the link below since we're not setting
any global privileges.
Click the Go button to save the new user.
Now we can see the new user has been added to our list.