In Linux, databases such as MySQL, PostgreSQL, SQLite, MongoDB, Redis, DB2, and Cassandra can be managed using Database Management Commands. They allow users to create and delete databases, modify tables, execute SQL statements, back up and restore databases, and export and import data. Their command-line interface makes it easier to automate database management tasks and integrate them with other Linux tools and scripts.
Command | Description |
---|---|
mysql | A command-line tool for managing MySQL databases, such as creating and deleting databases, tables, and users, as well as executing SQL queries. |
mysqldump | A command-line tool for backing up MySQL databases, allowing you to save database contents to a file for later restoration. |
sqlite3 | A command-line tool for managing SQLite databases, such as creating and modifying tables and executing SQL statements. |
sqlite3_backup | A command-line tool for backing up SQLite databases, allowing you to save database contents to a file for later restoration. |
psql | A command-line tool for managing PostgreSQL databases, similar to mysql but with specific PostgreSQL commands. |
pg_dump | A command-line tool for backing up PostgreSQL databases, allowing you to save database content to a file for later restoration. |
pg_restore | A command-line tool for restoring PostgreSQL database backups is created with pg_dump. | mongod | A command-line tool for managing MongoDB databases, including starting and stopping the database server, creating and modifying databases and collections, and running database commands. |
mongoexport | A command-line tool for exporting data from MongoDB databases to various file formats, including JSON, CSV, and TSV. |
mongoimport | A command-line tool for importing data into MongoDB databases from various file formats. |
mongodump | This command is used to create backups of MongoDB databases. It creates a binary export of the database data and metadata, including indexes, users, and roles, in a specified directory. |
mongorestore | This comand is used to restore data from binary backup files created by mongodump. You can restore data to either a local or remote MongoDB instance and control the restore process in a variety of ways, including ensuring that authentication, compression, and indexes are created. |
redis-cli | A command-line tool for managing Redis databases, including executing commands, managing data structures, and monitoring Redis performance. |
redis-cli BGSAVE | A command-line command for backing up Redis databases, allowing you to save the current database to disk while the database continues to serve clients. |
redis-cli --rdb file.rdb | A command-line command to restore Redis databases from an RDB file. |
db2 | A command-line tool for managing IBM DB2 databases. This allows you to create, modify, and query DB2 databases. |
cassandra-cli | A command-line tool for managing Apache Cassandra databases. It allows you to interact with Cassandra databases using a simple command-line interface. |