tencent cloud

Feedback

Creating Database

Last updated: 2023-11-22 14:30:41
    This document describes how to create a database and manage database account permissions on the Database Management tab in the TDSQL-C for MySQL console.

    Directions

    1. Log in to the TDSQL-C for MySQL console and click the ID of the target cluster in the cluster list or Manage in the Operation column to enter the cluster management page.
    2. On the cluster management page, select the Database Management page and click Create Database.
    
    
    3. In the pop-up window, configure the following parameters and click OK:
    
    
    Parameter
    Description
    Database Name
    Enter the database name, which can contain up to 64 letters, digits, hyphens, and underscores and must start with a letter and end with a letter or digit.
    Character Set
    Set the character set supported by the database. For more information, see MySQL documentation.
    Collation
    Set the sorting rule of the database. For more information, see MySQL documentation.
    Authorize User
    Click Add and select the account to be authorized, permissions to be granted, and host information. You can also delete the authorization record.
    Remarks
    Enter remarks for the database, which can contain up to 256 characters.

    Account authorization details

    You can grant an account the read-only, read-write, DML, DDL, and read-only & index permissions of the created database. The permissions and corresponding SQL statements are as follows:
    Permission
    Authorization Details
    Authorization SQL Statement
    Read-only
    SELECT
    LOCK TABLES
    SHOW VIEW
    ``GRANT SELECT, LOCK TABLES, SHOW VIEW ON `database`.* TO 'account'@'%'``
    Read-write
    ALL PRIVILEGES
    ``GRANT ALL PRIVILEGES ON `database`.* TO 'account'@'%'``
    DML
    SELECT
    INSERT
    UPDATE
    DELETE
    CREATE TEMPORARY TABLES
    LOCK TABLES
    EXECUTE
    SHOW VIEW
    EVENT
    TRIGGER
    ``GRANT SELECT, INSERT, UPDATE, DELETE, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, SHOW VIEW, EVENT, TRIGGER ON `database`.* TO 'account'@'%'``
    DDL
    CREATE
    DROP
    INDEX
    ALTER
    CREATE TEMPORARY TABLES
    LOCK TABLES
    CREATE VIEW
    SHOW VIEW
    CREATE ROUTINE
    ALTER ROUTINE
    ``GRANT CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `database`.* TO 'account'@'%'``
    Read-only & index
    SELECT
    INDEX
    LOCK TABLES
    SHOW VIEW
    ``GRANT SELECT, INDEX, LOCK TABLES, SHOW VIEW ON `database`.* TO 'account'@'%'``
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support