Summary of MySQL for IU Sitehosting API stored procedures

On this page:


Overview

This information is a quick reference to explain the API stored procedures available in MySQL for IU Sitehosting. 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');

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" (that is, schemas with no tables), are ignored.

Back to top

api.createUserBasic

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.createUserBasic 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 nine characters in length.
  • It must contain at least two lower and two upper case characters.
  • It must contain at least two numbers.
  • It must contain at least two special characters.

Back to top

api.createUserReadOnly

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.

Back to top

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.

Back to top

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 createUserReadOnly() or createUserBasic().

The password must satisfy the following requirements:

  • It must be at least nine characters in length.
  • It must contain at least two lower and two upper case characters.
  • It must contain at least two numbers.
  • It must contain at least two special characters.

Back to top

api.dropUser

Summary: Drops user with provided username and host

Back to top

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';

Back to top

api.grantExecFunct

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

Back to top

api.grantExecProc

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

Back to top

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()

Back to top

api.listProcedures

Summary: Provides a list of all available API procedures.

Back to top

api.listUsers

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

Back to top

api.revoke

Summary: Procedure revokes specified privileges of the provided user.

Back to top

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.

Back to top

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.

Back to top

api.setPassword

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

The password must satisfy the following requirements:

  • It must be at least nine characters in length.
  • It must contain at least two lower and two upper case characters.
  • It must contain at least two numbers.
  • It must contain at least two special characters.

Back to top

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');

Back to top