Run sql query via console?

Is it possible to run SQL query via console? I want to create setup file, that will run several console commands so that they will preset my default piwik installation. E.g. i need to create new users, different logo, name custom dimensions … Many commands, that are not in console. So i wonder if there is a way, how to make them directly to db