Running SQL file from inside rake task


#1

My friends,

I have a rake task that I’m running to initialize some stuff for new
servers.

I need to run a SQL file from inside that rake task. It’s just a big,
raw SQL file.

How can I run the SQL file from inside the rake task?

Thanks in advance for any good advice.


#2

mysql -uroot databasename < sqlfile.sql


#3

ActiveRecord::Base.connection.execute( )