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:

  1. 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

  2. After successfully logging into the MySQL server, issue the following statement to access the mysql database, which holds the user table:

    use mysql

  3. 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,, the following command is to be issued:

    CREATE USER ‘john’@’’ IDENTIFIED BY ‘john’;



    1. The CREATE and GRANT commands are case-sensitive; therefore, take care while specifying the user name, password, and privileges.
    2. 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.
  4. 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 to run the MySQL Network test, your command should be:

    CREATE USER ‘john’@’’ IDENTIFIED BY ‘john’;


  5. 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 topic. The MySQL server should be added/managed in the eG administrative interface using its IP address only, and not its host name. Then, proceed to configure the tests. While doing so, remember to configure the user name and password parameters with the name and password (respectively) that corresponds to the eG agent’s IP address in the user table.