Pre-requisites for Monitoring the MySQL Server
To run the MySQL tests, the eG agent should be configured with the credentials of a user who has server-wide process and select privileges. If such a user does not pre-exist, then, in the user table of the mysql database of the target MySQL server, you need to manually create a user account with the aforesaid privileges. To create and configure such a user, follow the procedure discussed below:
To create a new user account, you must connect to the MySQL server as the MySQL root user. For that, first login to the MySQL host, and at the command prompt, issue the following command:
mysql -u root
If you have assigned a password to the root account, you will also need to supply a - password or -p option, as shown below:
mysql -u root -pegurkha
After successfully logging into the MySQL server, issue the following statement to access the mysql database, which holds the user table:
Then, at the MySQL prompt, issue the following command to create a user:
CREATE USER ‘<username>’@’<IP_address_of_eG_agent>’ IDENTIFIED BY ‘<password>’;
GRANT PROCESS,SELECT ON . TO ‘<username>’@’<IP_address_of_eG_agent>’;
For instance, to ensure that user john (with password john) is able to connect to the MySQL server (being monitored) from the eG agent host, 192.168.8.91, the following command is to be issued:
CREATE USER ‘john’@’192.168.8.91’ IDENTIFIED BY ‘john’;
GRANT PROCESS,SELECT ON . TO ‘john’@’192.168.8.91’;
- The CREATE and GRANT commands are case-sensitive; therefore, take care while specifying the user name, password, and privileges.
- Only the IP address of the eG agent's host can be provided as part of the CREATE command's syntax; the host name of the eG agent cannot be provided instead.
To ensure that the external agent is able to execute the MySQL Network test, make sure that you create a user with the same credentials (i.e., name and password) and privileges as above and map that user to the IP address of the external agent. For instance, in the example above, to enable the external agent at IP address 192.168.8.92 to run the MySQL Network test, your command should be:
CREATE USER ‘john’@’192.168.8.92’ IDENTIFIED BY ‘john’;
GRANT PROCESS,SELECT ON . TO ‘john’@’192.168.8.92’;
- Once the above-mentioned commands execute successfully, the user table will be updated with two records for the user account that was newly created - one mapped to the internal/remote agent’s IP address and another mapped to the external agent’s IP address.
Once the pre-requisites are set, manage the MySQL server using the procedure explained in the Managing the MySQL Server