Summary of MySQL for Webserve API stored procedures

Following is a quick reference to explain the API stored procedures available in MySQL for Webserve. To access a detailed description of each procedure, including a list of parameters and examples, run a statement within MySQL using the following format:

  CALL api.help(‘procedureName’);

On this page:


api.checkDbSize

Summary: Provides the size of all your account schemas in MB.

The procedure only takes into consideration those schemas that contain at least one table; "empty schemas" (i.e., schemas with no tables), are ignored.

api.createBasicUser

Summary: Creates schema user and grants it SELECT, INSERT, UPDATE, and DELETE privileges on the specified schemas.

Make sure that you supply the correct name for the schema's suffix. When granting privileges, MySQL does not check for the existence of the schema and will therefore grant privileges to non-existing schemas. If you want to know the privileges that a particular user has, run:

  SHOW GRANTS for 'prefix_suffix'@'host';

api.createBasicUser always creates a new user. Do not use this procedure to grant additional read access to an already existing user.

The password must satisfy the following requirements:

  • It must be at least eight characters in length.
  • It must contain at least one lower and one upper case character.
  • It must contain at least one number.
  • It must contain at least one special character.

api.createReadOnlyUser

Summary: Creates schema user and grants it only SELECT (read-only) privileges.

Make sure that you supply the correct name for the schema's suffix. When granting privileges, MySQL does not check for the existence of the schema and will therefore grant privileges to non-existing schemas. To add more privileges or more granularity, use the api.grant procedure.

api.createSchema

Summary: Creates schema following API's naming convention. It automatically takes the prefix of the user calling the procedure and prepends it to the provided suffix parameter.

api.createUser

Summary: Creates schema user. Once the user is created, it is given USAGE privileges, which will basically allow the user to see your schemas, but nothing else.

In order to add privileges to one of your schemas or even granular privileges (for example, rights to a specific column in a specific schema), after creating the user you may use the api.grant() procedure. For a faster/easier way to create common user, you may want to use the createReadOnlyUser() or createBasicUser().

The password must satisfy the following requirements:

  • It must be at least eight characters in length.
  • It must contain at least one lower and one upper case character.
  • It must contain at least one number.
  • It must contain at least one special character.

api.dropUser

Summary: Drops user with provided username and host

api.grant

Summary: First revokes all current user privileges and then replaces them with the one(s) provided

You can only grant privileges to already existing users. You can obtain a list of your current users by calling api.listUsers(). Use the procedure api.createUser to add additional users.

If you want to know the privileges that a particular user has, run:

   SHOW GRANTS for 'prefix_suffix'@'host';

api.grantExecFunct

Summary: Grants EXECUTE privileges on the provided schema and function name to a single user-host combination.

api.grantExecProc

Summary: Grants EXECUTE privileges on the provided schema and procedure name to a single user-host combination.

api.help

Summary: Displays the help associated with each of the API's procedures. This documentation includes three sections: description, procedure parameters, and examples.

You can also get to this description by running:

  CALL api.help('me');

For a list of all procedures ran:

  CALL api.listProcedures()

api.listProcedures

Summary: Provides a list of all available API procedures.

api.listUsers

Summary: Provides a list of all your account users; i.e., all users with the same prefix (first part of the username).

api.revoke

Summary: Procedure revokes specified privileges of the provided user.

api.revokeExecFunct

Summary: Revokes EXECUTE privileges on provided schema and function name to a single user-host combination.

Execute privileges must be revoked one procedure at a time; using * for all available procedures will result in an error.

api.revokeExecProc

Summary: Revokes EXECUTE privileges on provided schema and procedure name to a single user-host combination.

Execute privileges must be revoked one procedure at a time; using * for all available procedures will result in an error.

api.setPassword

Summary: Sets the password for provided user-host combination.

The password must satisfy the following requirements:

  • It must be at least eight characters in length.
  • It must contain at least one lower and one upper case character.
  • It must contain at least one number.
  • It must contain at least one special character.

api.showGrants

Summary: Shows the grants for provided username and host combination.

To obtain a list of all your users, use the api.listusers() procedure. For more information, run:

  CALL api.help('listUsers');

This is document apyw in the Knowledge Base.
Last modified on 2018-11-02 10:52:52.

Contact us

For help or to comment, email the UITS Support Center.