C.3 Preparing the MySQL Database

To prepare the MySQL database, you must create a tablespace and auditusr account on the MySQL server. The tablespace and account enable the Secure Logging Server to log data to MySQL.

Although creating the tablespace is relatively straightforward, determining the hostname in the user account requires some planning. MySQL uses a username@hostname scheme for granting access to databases. If a user tries to log in with a valid user ID but the host name or IP address is incorrect, MySQL denies access to the user. The % wildcard grants access to a user logging in from anywhere except the localhost.

To determine the hostname for your user account, consider the following guidelines:

To create the tablespace and user account:

  1. On the server hosting the MySQL server software, type the following then specify the password when prompted:

    mysql -u root -p 
    

    This loads MySQL Monitor and attempts to log in as user root. The -p switch instructs MySQL Monitor to request a password. When MySQL Monitor loads, a mysql prompt appears.

    Depending on the server platform, you can also launch MySQL Monitor through the Mysql folder.

  2. Create the Nsure Audit tablespace:  

    CREATE DATABASE naudit;
    

    NOTE:You do not need to create the database table; the MySQL driver, lgdmsql, automatically creates this table when the logging server first loads the current Channel object configuration in memory. For more information on the table structure, see Section 7.9.1, MySQL Channel Driver.

  3. Create the Nsure Audit (auditusr) user account:

    GRANT all on naudit.* to auditusr@'%'IDENTIFIED by 'password'; 
    

    The user account has access from any IP address or host name. Be sure to replace password with the desired password for the user account.

  4. Define which database to query:

    \u mysql
    
  5. Confirm the creation of the auditusr account:

    select host,user from user;
    

    In the User column, you should see auditusr next to the appropriate host.