Someone sent me the sql files of a dump database. I imported it through the following command: psql my_dbname < infile.sql
I changed my database.yml file with the following:
development:
<<: *default
database: my_dbname
But when I run rails server, I don't have the expected data. Is there something I'm missing ? I think there are some stuff I need to do with roles but I'm not sure.
Thanks :)
Are you done with rake db:create
and rake db:migrate
before importing the .sql file if not then do the following
rake db:create
rake db:migrate
and then import .sql file
psql my_dbname < infile.sql
You can try:
rake db:create
rake db:migrate
psql -d my_dbname -a -f infile.sql
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.