Adding MySQL users
Applies to: MySQL
This article assumes the user has successfully installed MySQL and the MySQL GUI tools as described in the article Installing MySQL
Although MySQL Administrator is used in this discussion there are many other alternatives for interacting with the MySQL database. A web search will find numerous third party utilities while users familiar with MySQL may prefer to use the command line.
Installing MySQL creates a default user account - 'root'. The root account is the most fundamental or privileged MySQL user and is generally only used by the person who maintains and administers the MySQL server. Operators involved in the day to day running of MySQL applications (such as Timestone Software Version 4) usually connect with a different user account that gives them only enough privileges to run the software while restricting them from potentially harmful privileges such as DROP (where users, tables or even the entire database be deleted).
In this article the root account shall be used to launch the MySQL Administrator and create another user account with more limited privileges.
Launching MySQL Administrator
MySQL Administrator is launched by running this file:
C:\Program Files\MySQL\MySQL Tools for 5.0\MySQLAdministrator.exe
Note the use of the root user account in the above screen grab. This is needed in order to have sufficient privileges to create and modify additional users
Add a user
Once the MySQL Administrator has launched perform the following steps to add a user.
- Select the User Administration object on the left hand side of the MySQL Administrator window. The root account should already be listed in the Users Accounts list in the lower left
- Click 'Add new user'
- Enter a MySQL username and password and click 'Apply changes'. The new user is added to the Users Accounts list
In the example above the user has been created with the name 'timestone but the choice of name is entirely arbitrary'
Where the user can connect from
By default new users (including the root user) can connect from any host computer. It is possible to restrict the computers from which a user can connect from (the host computer). Although many people make use of the added security this step provides, its implementation is optional and at the user's discretion. Once a host has been added the user can only connect from the computer(s) specified.
- In the Users List, right click the user created above and select 'Show hosts in user list'
- Repeat the previous step and select 'Add host from which user can connect'
- Enter an IP address.
Note the use of the % wildcard which can be used in any of the ip address parts
Granting privileges to a user
As mentioned earlier the root user account should have all privileges. However the Timestone Software operators using Version 4 programs at the workstations do not need all MySQL privileges and for security purposes it is available to grant such users sufficient privileges to run the software only.
- Select the user in the user list and, if defined, the host from which they can connect from
- Select the Schema Privileges tab
- Select the timestone database from the Schemata list
- From the list of Available Privileges assign the user the following privileges
- Click Apply changes to assign the privileges
End of article