Link You Today
Bookmark your Free, Libre software & tech link

Run MySQL/MariaDB queries from command line

mariadb, mysql

If you are in charge of managing a database server, from time to time you may need to run a query and inspect it carefully. While you can do that from the MySQL / MariaDB shell, but this tip will allow you to execute the MySQL/MariaDB Queries directly using the Linux command line AND save the output to a file for later inspection.

MySQL is a relational database server with a great reputation for being fast, consume few resources and adapt very well to the demands of the web.

MariaDB is one of the most popular database servers in the world. It’s made by the original developers of MySQL and guaranteed to stay open source. Notable users include Wikipedia, Facebook and Google. MariaDB 5.5 is MariaDB 5.3 + MySQL 5.5, with added features.