I try to import some data to my localhost project and i dont know what to do. My task for this look like this right now:
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
But i have error:
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
Problem is that there is such table in my development database. What i do wrong? How can i import my_database.sql to localhost development database.
This isn't a Rake or Ruby on Rails error. Have you tried running that command on the command line?
The problem is that you're trying to import a MYSQL or PostgreSQL dump into SQLite.
I don't think SQLite understands AUTO_INCREMENT
- I believe it should be AUTOINCREMENT
( SQLite AutoInc )
Try changing your DB to PostgreSQL or modify the dump to be SQLite compatible.
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.