I do a fair bit of work at the command line. When I start my computer up on of the first things I do is open up a terminal window for mysql, and one for the Rails console and usually a third running mongrel. Setting it up every morning is a bit of a drag so I would like to script it. How can I open a terminal window, log into mysql, select my development database and then leave it there at the mysql prompt waiting for me. I know how to execute a mysql statement from bash, I just don't know how to get it to leave the prompt open for me to work with after. Hopefully that is clear!
Update: Combining the two answers below got things working for mysql. Thanks!
Now I am trying to get a gnome-terminal window to stay open running the Rails script/server command so I can watch the output. For some reason the following closes almost immediately:
gnome-terminal -e "ruby /home/mike/projects/myapp/script/server" &