Task C Creating a Database User

For testing purposes, this section explains the steps required to create the database user with appropriate privileges in a database, using the MySql database server.

Note: For production systems using Oracle, SQL Server and DB2 database server, work with your database administrator to create a database user in the appropriate database.

Procedure

  1. Verify that you are connected to the MySql database server as a root user. If not, type the command:
       mysql -u root -p
  2. Type the following command at the mysql command prompt to create a new user:
       create user ’asguser’ identified by ’asgpass’;
  3. To grant the appropriate privileges to the database user, type the following command at the mysql command prompt:
       grant create,select,insert,update on asgstat.* to asguser@'%'    identified by ’asgpass’;
  4. Type the following command to reload the privileges from the grant tables in the database:
       flush privileges;
    • For Oracle Database

      Ask your database administrator to create a database user (for example asguser) and grant the connect,resource privileges to this user.

    • For MS SQL Server Database

      Ask your database administrator to create a database user (for example asguser) and grant create,select,insert,update privileges to this user.

    • For DB2 Database

      Ask your database administrator to create a database user (for example asguser) and grant ALL,CONTROL,CONNECT,insert,SELECT privileges to this user.