我尝试将一些数据导入到我的本地主机项目中,但我不知道该怎么做。我的任务现在看起来像这样:
desc "imports the devel databse dump file to www2_sw"
task :dumpimport => :environment do
puts "Loading www2_sw_development_dump.sql. Enter mysql root password. Just press Enter for none"
`sqlite3 development.sqlite3 < db/sql/geo_cities_states.sql`
end
但我有错误:
Error: near line 5: near "AUTO_INCREMENT": syntax error
Error: near line 22: no such table: cities
Error: near line 573: no such table: cities
Error: near line 904: near "AUTO_INCREMENT": syntax error
Error: near line 914: no such table: states
问题是我的开发数据库中有这样的表。我做错了什么?如何将 my_database.sql 导入 localhost 开发数据库。