In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Under Windows
Service check
Home page to see if the service is running
Find the postgresql service
The service is running
Execute a command
Command line management
Open the cmd command line
Connect database command
Access PostgreSQL database: psql-h IP address-p port-U database name
Errors may occur:
In this case, you need to configure the environment variables of postgresql.
Find the bin folder under the installation directory of disk c
Set environment variabl
Interface settin
Right-click "my computer", click Properties, pop up Properties, and then click Advanced Settings to pop up the Advanced Settings interface.
Click the Environment variable pop-up Environment variable Settings button on system Settings
Select "path" and click "Edit"
Just click New to save.
Command settin
Enter set path
You can see the current variable value of path
Enter set path=% path%; C:\ PostgreSQL\ pg96\ bin; to append our path to the variable
Be careful that there are no spaces in the path. Paths with spaces will not be recognized.
Execute the psql-- help command again after the environment variable has been modified
Indicates that the environment variable is set successfully
Access PostgreSQL database: psql-h IP address-p port-U database name
Psql-h localhost-p 5432-U postgres
Localhost stands for local
5432 is the default port number for postgresql
Postgres is the default user of postgresql
The presence of this screen indicates a successful connection
Enumerate database
\ l command
Will list all the database information and select the database.
\ C Database name
Switch to Test database and pay attention to case sensitivity
Query data from database
Select * from User
Pay attention to the semicolon after';'
Backup database
Pg_dump-h server-p port number-U user name-d dbname-f sql file path
Examples
Pg_dump-h localhost-p 5432-U postgres-d Test-f:\ Test.sql
After the execution is finished, go to the f disk to view the Test.sql file
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.