Creating a read-only database user account for MySQL

Article:HOWTO30408  |  Created: 2010-01-17  |  Updated: 2010-01-18  |  Article URL http://www.symantec.com/docs/HOWTO30408
Article Type
How To


Environment


Creating a read-only database user account for MySQL

Collectors that use a database sensor require that you create a read-only database user account so that the collector can query for events.

See Installing collectors that use a database sensor.

To create a read-only database user account for MySQL

  1. Run the MySQL command-line program by doing one of the following:

    • At a UNIX prompt, run the MySQL command-line program, and log in as an administrator by typing the following command:

      mysql -u root -p

    • At a Windows command prompt, run the MySQL command-line program, and log in as an administrator by typing the following command from the MySQL root folder:

      mysql -u root -p

    • Run any database shell that works with MySQL. For example: SQuirreL SQL client and MySQL Workbench (Query Browser).

  2. Type the password for the root account.

  3. Create a user account by typing the following command:

    CREATE USER user_name;

  4. Set a password for the new user account by typing the following command:

    SET PASSWORD FOR user_name = PASSWORD ('password');

  5. Grant the user access to read data from the needed tables. Type the following command:

    GRANT SELECT ON database_name.table_name TO user_name;

  6. Type quit to leave the SQL shell or, if using a SQL client, close the SQL client.


Legacy ID



355753


Article URL http://www.symantec.com/docs/HOWTO30408


Terms of use for this information are found in Legal Notices