Unable to connect Rails application directly to SQL file. The Rails application retrieves its data from the database server and imports the contents of the SQL file into a database hosted on the server.
DMG, MySQL Community Server Mac http://dev.mysql.com/downloads/mysql/#downloads
.
MySQL root (.. ),
mysqladmin -u root password "secret"
&mdash. , secret , .
database.yml Rails. app :
development:
adapter: mysql
database: app_development
username: root
password: secret
host: localhost
test:
adapter: mysql
database: app_test
username: root
password: secret
host: localhost
production:
adapter: mysql
database: app_production
username: root
password: secret
host: localhost
, Rails MySQL, root .
rake db:create Rails . app_development MySQL (rake db:create:all ). , SQL, Terminal :
mysql -u root -p app_development < path/to/file/name.sql
MySQL. path/to/file SQL, . , ~/Desktop/name.sql, .