Rails connection postgresql error: psql: Fatal error: User "s" Ident authentication failed, psqlpostgresPsql: Fatal error: User "s" Ident authentication failed
1. After the postgresql database is installed, you must initialize and configure some rails projects to connect to postgresql.
After postgresql data is installed (the yum command is directly installed)
Step 1: Initialize the database
# Service postgresql initdb
(Note: After initialization, the default postgresql database has a default us
1. sudo apt-get install PostgreSQL #安装psql2. Su passwd postgres #设置postgres账户的密码3. postgresql.conf sets the value of the Listen_addresses key in the file to4. pg_hba.conf the configuration file, add the following configuration under the host all 127.0.0.1/32 MD5 lineHost All 0.0.0.0/0 MD55. The above configuration file is installed by default under/etc/postgresql/9.4/main6.Sudo/etc/init.d/postgresql start #
field type in the table. 4.Extract procedures/functions/packages[[emailprotected]_222 ~]# ora2pg-c/etc/ora2pg/ora2pg.conf[========================>] 2/2 functions (100.0 %) end of output. [[emailprotected]_222 ~]# cat lottu04.sql--Generated by ORA2PG, the Oracle database Schema Converter, version 17.4- -Copyright 2000-2016 Gilles darold. All rights reserved.--DATASOURCE:dbi:Oracle:ora229SET client_encoding to ' UTF8 '; \set on_error_stop ONCREATE OR REPLACE F Unction ora2pg_16_to10 (v_16_data t
Operating environment for Kali virtual machines
1
[Email protected]:~# apt-get Install PostgreSQL
Start the service
12
[Email protected]:~# service PostgreSQL start[OK] starting PostgreSQL 9.1 database Server:main.
Modify the PostgreSQL password to Toor:
123
[Email protected]:~# sudo-u postgres psql postgrespostgres=# alter user p
Statement:Postgres-version 9.2.5* Specific installation methods refer to the following link:1. http://blog.scimpr.com/2014/08/11/ubuntu12-04%E3%81%A7postgresql%E3%81%AE%E5%85%A8%E6%96%87%E6%A4%9C%E7%B4% a2%e3%80%9ctextsearch_ja/* Summary of problems encountered during installation:1. The "Make use_pgxs=1" Command error occurred when the link operation was performedTip: "Pgxs.mk File not found" error, reason, missing reference rpm package.Execution: Yum Install
process them separately according to the various commands of the client.The client initiates the request, and the PG server initiates a postgres access process for that request, which establishes a connection for that client through access. This postgres access process enters an infinite loop, waits for the client to request and pass the service for it until the process terminates, connecting the fracture.
Label:Recently the company requested to back up the database, so we looked up the comparative information. Don't say much nonsense, into the subject. Objective: To regularly back up the Postgres database under Ubuntu, and to pack and upload to the designated FTP server. After finding the information, the workaround: ① Write a backup database, package compression, upload the specified FTP script. ② adds the script to the Ubuntu scheduled Tasks crontab.
This is a creation in
Article, where the information may have evolved or changed. "' Gopackage mainimport (" FMT "" Log "" Time "" Github.com/go-xorm/xorm "_" GITHUB.COM/LIB/PQ ") var engine *xorm. Enginefunc Main () {}func init () {psqlinfo: = FMT. Sprintf ("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable", "127.0.0.1", 5432, "Postgres", "12345678", " Postgres ") var err errorengine, err = X
First, IntroductionJSON is a full copy of the input, and then parse it, so it preserves the input spaces, repetition keys, and order. The JSONB is a binary that is saved after parsing the input, and it removes unnecessary spaces and duplicate keys when parsing, and the order and input may not be the same. Make time without parsing again.Summarize:
.
JSON
jsonb
Save
Fast
Slow
Take
Slow
Fast
Ii. Practice
0. Remove unnecessary tables and stored procedures from the 200 server Setup database
DROP TABLE "Sensorpressure";DROP FUNCTION hex_to_int (text);DROP FUNCTION "Pressuredatatosensorpressure" ();
1. Back up 200 of the SETUPD database,:p g_dump-d-H localhost-u pgsql mydb (database name) > Mydb.bak
2. Reduction of setupdb to 172 graindb:p sql-h localhost-u pgsql-d graindb
(encountered a problem: prompt-D option is invalid swap with another command to back up a large database, view the
Tags: data res postgre using server ant value Sage selThe following is the installation, configuration, use of FDW to achieve Postgres database mutual access method, reproduced annotated Source:1, source installation FDW support (requires database source installation)Cd/usr/local/postgresql-9.3.2/contrib/postgres_fdwMakeSuMake install2. Create FDW extension (log in to Super User database)\c Postgres Postgre
Tags: logging writing default installation operation memory RAM parameter configuration CREATE indexBecause it is a development phase, there are no parameters configured for Postgres, all using the default configuration at the time of installation,It's not unusual to run in the past, but my CPU resource usage has suddenly risen in the last few days.Review the process, found that there is a postgres process
Label: --View current Server database
SELECTDatname fromPg_database--view the created user table
SELECT * fromPg_stat_user_tables--Create a database
CREATE DATABASE"Fxsz_lt" withOWNER=Postgres ENCODING='UTF8'tablespace=Pg_default--lc_collate= ' Chinese (Simplified) _people ' s Republic of china.936 '
--lc_ctype= ' Chinese (Simplified) _people ' s Republic of china.936 'CONNECTION LIMIT=-1;
--Deleting a database
DROP DATABASElitao_test--CREATE TABLE S
Label:1. Switch to Postgres user;2. Enter: Psql, enter the client psql of PostgreSQL;3.\l View all the current databases;4.psql Database1 connected to database1 this database;5. \dt View all the tables of the currently connected database (DATABASE1);6. \d Table1 View the table structure of table table1;Also: Modify a user's password in ubuntu:1. Switch to the root account;2. passwd account name;3. Follow the instructions, enter a new password, complet
Label:Excerpt from: http://www.cnblogs.com/yjf512/p/4402096.html The view in Postgres scans the sub-table when it is queried, while materialized views actually save the data in a single table. Materialized views are something that is only after 9.3. Create a View CREATE OR REPLACE VIEW student_view asselect *from
student
left JOIN teacher
on= teacher.id; Create a materialized view CREATE VIEW student_view_m asselect *from
stud
1. Save Excel as a CSV2. Open CSV format with TXT3. Encoded in UTF-8 format, save as Blacklist20141231.csv4. Create a tableCreate table backlist_20141231 (date varchar (20), mobile number nvarchar (20), channel nvarchar (50));5. Using the Copy command, copy backlist_20141231 from ' D:/blacklist20141231.csv ' delimiter as ', ' csv quote as ';This error, is not carefully caused, from ' D:/blacklist20141231.cs ' should be from ' d:/blacklist20141231.csv '; change it.6. Now the encoding format or GB
Tags: Linux shell postgresIn the work often to develop and test import and export some test database, so wrote a script for easy operation.The company is currently using the postgres9.3 database.#!/bin/bash #定义一些变量和操作命令 dbs= "DB1NBSP;DB2NBSP;DB3NBSP;DB4" Expdb_cmd=/usr/pgsql-9.3/bin/pg_dump DBCMD=/usr/ Pgsql-9.3/bin/psql dbuser=postgres dbsvr=mydbhost1 #导出数据库 functionexportdb () {read-p " inputdatabaseusernametoexport: "srcdb read-p" inputexportpath:
After postgres8.3, the default transitions between field data are canceled. If a data transformation is required, in the Postgres database, we can use "::" To convert the field data into a type. The actual "::" is called by the cast function. exactly what fields can be converted between data? This problem can be answered only by studying the cast function. The information of the cast function is managed in the System Pg_cast table. through the query
---------------------Common functions|_LIBPQ------------------front-end |_makefile---------------Makefile File|_nls.mk----------------|_nodes-----------------the related processing function of constructing tree nodes|_optimizer--------------Optimizer|_parser-----------------SQL Statement Parser|_po---------------------|_port-------------------Platform-related code|_postmaster------------Postmaster main function (resident Postgres)|_regex--------------
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.