How to view MySQL databases in Linux?

To view MySQL databases, you can use the following command line tool:

  1. mysql – a popular open-source relational database management system
mysql -u username -p

Afterwards, the username is the database user name. Upon executing this command, the system will prompt for the password.

  1. display databases;
show databases;
  1. select the database_name;
use database_name;

The database_name is the name of the database that you want to view.

  1. Display a list of tables.
show tables;
  1. Please provide a description of the table named “table_name.”
describe table_name;

table_name is the name of the table to be viewed.

  1. Retrieve all data from the table named “table_name.”
SELECT * FROM table_name;

table_name is the name of the table to be viewed.

These are some basic commands that you can further explore and use according to your own needs.

bannerAds