tencent cloud

Boost Engagement with Tencent RTC Free TrialFree video and chat features await!

Feedback

TDSQL-C for MySQL

Basic SQL Operations

Last updated: 2023-11-09 15:02:18
This document describes common SQL commands.
For more information on SQL commands, including command parameters and restrictions, see MySQL 5.7 Reference Manual.

Querying the version

Option 1:
MySQL [(none)]> SELECT CYNOS_VERSION();
+------------------------+
| CYNOS_VERSION() |
+------------------------+
| 5.7.mysql_cynos.1.3.10 |
+------------------------+
1 row in set (0.00 sec)
Option 2:
MySQL [(none)]> SELECT @@CYNOS_VERSION;
+------------------------+
| @@CYNOS_VERSION |
+------------------------+
| 5.7.mysql_cynos.1.3.10 |
+------------------------+
1 row in set (0.00 sec)
Option 3:
MySQL [(none)]> SHOW VARIABLES LIKE 'CYNOS_VERSION';
+---------------+------------------------+
| Variable_name | Value |
+---------------+------------------------+
| cynos_version | 5.7.mysql_cynos.1.3.10 |
+---------------+------------------------+
1 row in set (0.01 sec)

Database commands

Command
Sample
Create a database and specify the character set
CREATE DATABASE db01 DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci;
Delete a database
DROP DATABASE db01;

‌Account commands

Command
Sample
Create an account
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
Delete an account
DROP USER 'username'@'host';
Grant permissions
GRANT SELECT ON db01.* TO 'username'@'host';
Query an account in the database
SELECT user,host FROM mysql.user;
or
SHOW GRANTS FOR 'username'@'hostname';
Revoke permissions
Revoke all permissions: REVOKE ALL PRIVILEGES,GRANT OPTION FROM 'username'@'host';
Revoke specified permissions: REVOKE UPDATE ON *.* FROM 'username'@'host';


Catalog

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
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon