Import the database given by R sir

Database .yml mein jo bhi name daloge woh application.yml mein bhi set karoge

Note :: database.yml aur application.yml mein change krna hoga

database import -

i have to import new database which is given by rinku – that is local database

1. first the file given by rinku – download that

2. cut paste that to the normal folder of chingching

3. change the database name in application.rb and database.yml -

........................................................................................................................................

In database.yml -

database: 'chingchingbyakon_dev1' , test - database: 'ChingChing_test1'

........................................................................................................................................

in application.yml - development - database: 'chingchingbyakon_dev1', test - database:

'ChingChing_test1', production: ‘chingchingbyakon_dev1’

........................................................................................................................................

4. $ rake db:create - create the database

5. import the database –

sql file r sir ne mujhe bheji hai wheen se uska name milega mujhe

psql -U postgres `database_name` < sqlfilename

Ex: psql -U postgres chingchingbyakon_dev1 < local_data_25_05_2022.sql

.............................................

Note :: 

For writing rspecs we create a diff database - 

first we change the database name in database.yml in test section 

second we run below command to create the test databse 

bundle exec rake db:create RAILS_ENV=test




..............................................

note ::

is command par error de raha tha -

psql: FATAL: Peer authentication failed for user "postgres"

is error ko solve karne ke liye r sir ne command chalaye -

sudo nano /etc/postgresql/11/main/pg_hba.conf

sudo service postgresql restart

psql -U postgres chingchingbyakon_dev1 < local_data_25_05_2022.sql

note – ismein pehle postgres ko restart karna hoga

.............................................................................................................................................

check karna ki postgres ka name kya hai -


$ psql -U root -

error - psql: error: FATAL: Peer authentication failed for user "root"

$ psql -U postgres -

error - psql: error: FATAL: Peer authentication failed for user "postgres"

$ postgresql -v

postgresql: command not found

$ sudo nano /etc/po

polkit-1/

popularity-contest.conf postgresql/

postgresql-common/


$ sudo nano /etc/postgresql

postgresql/

postgresql-common/

$ sudo nano /etc/postgresql/1

11/ 13/

$ sudo nano /etc/postgresql/11/main/

conf.d/

environment

pg_ctl.conf

start.conf

pg_hba.conf

$ sudo nano /etc/postgresql/11/main/p

pg_ctl.conf

pg_hba.conf

pg_ident.conf

pg_ident.conf

postgresql.conf

$ sudo nano /etc/postgresql/11/main/pg_hba.conf

[sudo] password for user:

$ sudo apt-get --purge remove postgresql postgresql-*

$ sudo nano /etc/

$ sudo nano /etc/p

sudo nano /etc/po

sudo apt-get update

note -

r sir ne saari branch dekheen - $ git branch -a

meri branch account_deleted thi

note -

r sir ne database.yml mujhe bheji

r sir ne application.yml mujhe bheji

r sir ne postman ka database import karne ke liye mujhe link bheja

sql file

postgresql.conf

$ sudo nano /etc/postgresql/11/main/pg_hba.conf

[sudo] password for user:

$ sudo apt-get --purge remove postgresql postgresql-*

$ sudo nano /etc/

$ sudo nano /etc/p

sudo nano /etc/po

sudo apt-get update

note -

r sir ne saari branch dekheen - $ git branch -a

meri branch account_deleted thi


note -

r sir ne database.yml mujhe bheji

r sir ne application.yml mujhe bheji

r sir ne postman ka database import karne ke liye mujhe link bheja

sql file



Comments

Popular posts from this blog

Rails 7 Features :: Comparison with Rails 6 and Rails 5