GaussDB(for MySQL) is fully compatible with the MySQL protocol. Therefore, you can connect to a DB instance through a common connection or an SSL connection. SSL connections are encrypted.
For details about how to bind an EIP, see Step 2: Bind an EIP.
Add the IP address and port obtained in 1.b to the inbound rule of the security group.
For details about how to configure a security group rule, see Step 3: Configure Security Group Rules.
You can use a database client to connect to the DB instance in the Linux or Windows OS.
For details about how to obtain and install the MySQL client, see How Can I Install the MySQL Client?
The database client MySQL-Front is used as an example in Using MySQL-Front to Connect to a DB Instance.
Parameter |
Description |
---|---|
Name |
Database connection task name. If you do not set this parameter, it will be the same as that configured for Host by default. |
Host |
EIP bound to the target DB instance. To obtain this parameter, go to the Basic Information page of the DB instance. The EIP can be found in the Public IP Address (EIP) field in the Network Information area. |
Port |
Private network port of the DB instance. |
User |
Name of the user who accesses the DB instance. The default user is root. |
Password |
Password of the DB instance account. |
If the connection fails, ensure that preparations have been correctly made in Prerequisites and try again.
For details, see How Can I Import the Root Certificate to a Windows or Linux OS?
Parameter |
Description |
---|---|
<hostName> |
Host IP address of the target DB instance to be connected. To obtain this parameter, go to the Basic Information page of the DB instance. The EIP can be found in the Public IP Address (EIP) field in the Network Information area. |
<port> |
Database port. To obtain this parameter, go to the Basic Information page of the DB instance. The database port can be found in the Database Port field in the Network Information area. |
<userName> |
Username of the GaussDB(for MySQL) database administrator account. The default username is root. |
<caName> |
SSL certificate file name, which should be stored in the same directory where the command is executed. |
For example, to connect to a DB instance through an SSL connection as user root, run the following command:
mysql -h 10.16.0.31 -P 3306 -u root -p --ssl-ca=ca.pem
Enter the password of the database account as prompted:
Enter password:
If the connection fails, ensure that preparations have been correctly made in Prerequisites and try again.