TencentDB for MariaDB can be accessed in the following ways:
Note:
For public network access, the database instance's public IP needs to be enabled, which may expose your database service to attacks or intrusions on the public network. Therefore, it is recommended to log in to the database over the private network.
No matter whether you access the instance from the private or public network, you need to create an account first.
Login on Windows
1) Download and install a MariaDB client. SQLyog is recommended.
2) Open SQLyog. Enter the private IP, port number, and database account/password of the TencentDB for MariaDB instance.
3) After successful login, the following page will appear, where you can view the modes and objects of the TencentDB for MariaDB instance, create tables, and perform operations such as data insertion and query.
Login on Linux
1) In the following example, the CVM instance runs on CentOS 7.2 64-bit. You can use Yum, the package manager built in CentOS, to download and install the MySQL client from the Tencent Cloud image source.
Install the client by running the following command:
yum install mysql
The command is executed as shown below:
2) Log in to the TencentDB for MariaDB instance by using the MySQL command line tool.
mysql -h hostname -u username -p
Replace "hostname" with the private IP address of the target TencentDB for MariaDB instance, replace "username" with the username previously created, and enter its password when prompted with "Enter password:".
3) Under the prompt "MySQL>", you can send an SQL statement to the TencentDB for MariaDB server for execution. For specific command lines, please see here.
Take show databases;
for example as below:
Get the public network address of the instance.
1) Log in to the TencentDB for MariaDB Console and click an instance name or Manage in the "Operation" column.
2) On the instance details page, click Enable after the public network address to enable it.
3) After the public network address is enabled successfully, it will be displayed.
Log in to the instance.
Login on Windows
1) Download and install a MariaDB client. SQLyog is recommended.
2) Open SQLyog. Enter the public network domain name, port number, and database account/password of the TencentDB for MariaDB instance.
3) After successful login, the following page will appear, where you can view the modes and objects of the TencentDB for MariaDB instance, create tables, and perform operations such as data insertion and query.
Login on Linux
1) In the following example, the CVM instance runs on CentOS 7.2 64-bit. Download the MySQL client from the official website and install it with the following command:
yum intall mysql
2) Log in to the TencentDB for MariaDB instance by using the MySQL command line tool. The command is as follows:
mysql -h hostname -P port -u username -p
Replace "hostname" with the public network domain name of the target TencentDB for MariaDB instance, replace "username" with the username previously created, and enter its password when prompted with "Enter password:".
3) Under the prompt "MySQL>", you can send an SQL statement to the TencentDB for MariaDB server for execution. For specific command lines, please see here.
Take show databases;
for example as below:
Was this page helpful?