Got it

Common operation of GaussDB

Latest reply: Jul 29, 2021 01:54:26 1295 6 8 0 0

Hi, this is the common operation of GaussDB.


1.login operations

1.1 Connect to GaussDB

docker exec -it 66cd29b536556f18b579fb3b646b8678624216af0a05fd600f76f5ba6bd33d25 bash// Enter the GaussDB container

su - postgres; // Switch to the postgres user

gsql -d vcm; //login

Common operations of GaussDB    1.login operations


2. operations

2.1 Log out of the database

\q // Log out of the database

 GaussDB


2.2 Listing all databases

\l  // Listing all databases

GaussDB


2.3 Connect to other databases

\c [database_name]  // Connect to other databases

GaussDB


3. Operation on database tables

3.1.List all tables in the current database

\d // List all tables in the current database

GaussDB


3.2、List the structure of a table

\d [table_name]  // List the structure of a table

GaussDB


4. Operations on database table records

4.1.View the record of a table

select * from vias_conf;

GuassDB

4.2、Delete the record of a table

delete from vias_conf where id=1;

GaussDB

4.3、Insert a record in the table

INSERT INTO VIAS_CONF  VALUES (1,'10.134.195.152','7006','123','0123456',0 ,'111',0 ,'11111',NULL,NULL,NULL,NULL,NULL);

GuassDB

4.4 Modify the record of the specified field of the table

update vias_conf set password='123456' where id=1;

GuassDB



Thanks for reading!

Thanks!
View more
  • x
  • convention:

Good
View more
  • x
  • convention:

Good share
View more
  • x
  • convention:

Well note
View more
  • x
  • convention:

Good
View more
  • x
  • convention:

GaussDB (for Redis) is a cloud-native database developed by Huawei cloud database team that is compatible with the Redis protocol. GaussDB uses the computing and storage separation architecture, breaking the memory limit of open-source Redis, and can be easily expanded to PB-level storage.
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.