I'm attempting to script the creation of a machine image that includes MySQL with some seed data.
I'm looking for a way to start the MySQL database engine, run a .sql script to create the data, and then shutdown the engine. Is there a best way to do this?
It looks like I could use the --init-file argument of mysqld to launch mysql and run the script, but how would I cause the database engine to shutdown after the script completes?
I'm on Ubuntu if it matters.
mysqld shutdownimmediately after?